PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » XML » XML_SVG » Bug #4961

Package echoes text with htmlentities()

Details

Submitted2005-08-01 14:39 UTC
Fromjan dot pieter dot kunst at meertens dot knaw dot nl
Assignedyunosh
StatusClosed
PackageXML_SVG
PHP Version5.0.4
OSMac 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.