cvs: pear /Text_Wiki/Text/Wiki/Rule entities.php

From: Date: Sat, 22 May 2004 15:10:35 +0000
Subject: cvs: pear /Text_Wiki/Text/Wiki/Rule entities.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-19759@lists.php.net to get a copy of this message
pmjones Sat May 22 11:10:35 2004 EDT Modified files: /pear/Text_Wiki/Text/Wiki/Rule entities.php Log: fixed bug 1362, accented letters not translated to HTML entities. http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/Rule/entities.php?r1=1.2&r2=1.3&ty=u Index: pear/Text_Wiki/Text/Wiki/Rule/entities.php diff -u pear/Text_Wiki/Text/Wiki/Rule/entities.php:1.2 pear/Text_Wiki/Text/Wiki/Rule/entities.php:1.3 --- pear/Text_Wiki/Text/Wiki/Rule/entities.php:1.2 Sun May 2 09:12:43 2004 +++ pear/Text_Wiki/Text/Wiki/Rule/entities.php Sat May 22 11:10:35 2004 @@ -16,7 +16,7 @@ // | Authors: Paul M. Jones <pmjones@ciaweb.net> | // +----------------------------------------------------------------------+ // -// $Id: entities.php,v 1.2 2004/05/02 13:12:43 pmjones Exp $ +// $Id: entities.php,v 1.3 2004/05/22 15:10:35 pmjones Exp $ /** @@ -43,14 +43,14 @@ function parse() { - // first, decode any entities already in the text so that they - // don't get double-encoded - $trans_table = get_html_translation_table(HTML_SPECIALCHARS); - $this->_wiki->_source = strtr($this->_wiki->_source, - array_flip($trans_table)); - - // now encode all html special characters - $this->_wiki->_source = htmlspecialchars($this->_wiki->_source); + // get the translation table + $xlate = get_html_translation_table(HTML_ENTITIES); + + // remove the delimiter character it doesn't get translated + unset($xlate[$this->_wiki->delim]); + + // convert! + $this->_wiki->_source = strtr($this->_wiki->_source, $xlate); } }

« previous php.pear.cvs (#19759) next »