Home » XML » XML_SVG » Bug #4961
Package echoes text with htmlentities()
Details
| 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) |
Comments
[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.