cvs: pear /XML_FastCreate package.xml /XML_FastCreate/FastCreate Text.php

From: Date: Thu, 15 Dec 2005 16:37:26 +0000
Subject: cvs: pear /XML_FastCreate package.xml /XML_FastCreate/FastCreate Text.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-36881@lists.php.net to get a copy of this message
guillaume Thu Dec 15 16:37:26 2005 EDT Modified files: /pear/XML_FastCreate package.xml /pear/XML_FastCreate/FastCreate Text.php Log: BugFix: auto quote bug in some case http://cvs.php.net/viewcvs.cgi/pear/XML_FastCreate/package.xml?r1=1.6&r2=1.7&diff_format=u Index: pear/XML_FastCreate/package.xml diff -u pear/XML_FastCreate/package.xml:1.6 pear/XML_FastCreate/package.xml:1.7 --- pear/XML_FastCreate/package.xml:1.6 Sat Dec 10 17:26:54 2005 +++ pear/XML_FastCreate/package.xml Thu Dec 15 16:37:26 2005 @@ -44,11 +44,11 @@ </maintainers> <release> - <version>1.0.2</version> + <version>1.0.3</version> <state>stable</state> - <date>2005-12-08</date> + <date>2005-12-14</date> <notes> - All XML indentations removed + Bugfixes quote() </notes> <filelist> <dir name="/" baseinstalldir="/XML" role="php"> http://cvs.php.net/viewcvs.cgi/pear/XML_FastCreate/FastCreate/Text.php?r1=1.4&r2=1.5&diff_format=u Index: pear/XML_FastCreate/FastCreate/Text.php diff -u pear/XML_FastCreate/FastCreate/Text.php:1.4 pear/XML_FastCreate/FastCreate/Text.php:1.5 --- pear/XML_FastCreate/FastCreate/Text.php:1.4 Sat Dec 10 17:26:54 2005 +++ pear/XML_FastCreate/FastCreate/Text.php Thu Dec 15 16:37:26 2005 @@ -20,7 +20,7 @@ * @author Guillaume Lecanu <Guillaume@dev.fr> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Text.php,v 1.4 2005/12/10 17:26:54 guillaume Exp $ + * @version CVS: $Id: Text.php,v 1.5 2005/12/15 16:37:26 guillaume Exp $ * @link http://pear.php.net/package/XML_FastCreate * @see XML_Tree */ @@ -48,7 +48,7 @@ * @author Guillaume Lecanu <Guillaume@dev.fr> * @copyright 1997-2005 The PHP Group * @license http://www.php.net/license/3_0.txt PHP License 3.0 - * @version CVS: $Id: Text.php,v 1.4 2005/12/10 17:26:54 guillaume Exp $ + * @version CVS: $Id: Text.php,v 1.5 2005/12/15 16:37:26 guillaume Exp $ * @link http://pear.php.net/package/XML_FastCreate * @see XML_Tree */ @@ -272,24 +272,23 @@ if (is_string($str)) { $len = strlen($str); $new = $toQuote = ''; - $waitEnd = false; + $waitEnd = false; for ($i=0; $i < $len; $i++) { if ($str{$i} == '<') { - if (($str{$i+1} == '_') && ($str{$i+2} == '>')) { + if (($str{$i+1} == "'") && ($str{$i+2} == '>')) { $new .= $this->_quoteEntities($toQuote); $toQuote = ''; $waitEnd = true; - $i += 3; + $i += 2; + continue; } } if ($waitEnd && ($str{$i} == '<')) { - if (($str{$i+1} == '/') && ($str{$i+2} == '_') + if (($str{$i+1} == '/') && ($str{$i+2} == "'") && ($str{$i+3} == '>')) { $waitEnd = false; - $i += 4; - if ($i > $len) { - $i--; - } + $i += 3; + continue; } } if ($waitEnd) { @@ -300,9 +299,9 @@ } } } - $new = '<_>'.$new.$this->_quoteEntities($toQuote).'</_>'; + $str = "<'>".$new.$this->_quoteEntities($toQuote)."</'>"; } - return $new; + return $str; } // }}} // {{{ noquote() @@ -319,7 +318,7 @@ */ function noquote($str) { - return '<_>'.$str.'</_>'; + return "<'>{$str}</'>"; } // }}} // {{{ _unquote() @@ -334,7 +333,7 @@ */ function _unquote($str) { - return str_replace(array('<_>', '</_>'), array('', ''), $str); + return str_replace(array("<'>", "</'>"), array('', ''), $str); } // }}} // {{{ _quoted() @@ -350,7 +349,7 @@ function _quoted($content) { if ($this->_options['quote']) { - return '<_>'.$this->_unquote($content).'</_>'; + return "<'>".$this->_unquote($content)."</'>"; } return $content; }

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