Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.1.0

Bug #4961 Package echoes text with htmlentities()
Submitted: 2005-08-01 14:39 UTC
From: jan dot pieter dot kunst at meertens dot knaw dot nl Assigned: yunosh
Status: Closed Package: XML_SVG
PHP Version: 5.0.4 OS: Mac OS X
Roadmaps: (Not assigned)    
Subscription  


 [2005-08-01 14:39 UTC] jan dot pieter dot kunst at meertens dot knaw dot nl
Description: ------------ The printElement() method of the XML_SVG_Textpath wraps $this->_text in htmlentities(), but it should use htmlspecialchars(). (Named character entities like é don't exist in XML by default.) Test script: --------------- patch for the SVG.php file: --- /usr/local/php/lib/php/XML/SVG.php Mon Jun 13 09:22:32 2005 +++ SVG.php Mon Aug 1 16:31:19 2005 @@ -291,7 +291,7 @@ echo '<' . $element; $this->printParams('id', 'x', 'y', 'dx', 'dy', 'rotate', 'textLength', 'lengthAdjust', 'style', 'transform'); - echo '>' . htmlentities($this->_text); + echo '>' . htmlspecialchars($this->_text); parent::printElement(); echo "</$element>\n"; } Expected result: ---------------- I would expect to see accented letters as actual characters instead of named character entities in <text> elements. Actual result: -------------- Named character entities in <text> elements.

Comments

 [2005-08-01 14:53 UTC] yunosh
This bug has been fixed in CVS. In case this was a documentation problem, the fix will show up at the end of next Sunday (CET) on pear.php.net. In case this was a pear.php.net website problem, the change will show up on the website in short time. Thank you for the report, and for helping us make PEAR better. I have also added an optional "charset" parameter to XML_SVG_Textpath to use in conjuction with the htmlspecialchars() call.