PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Images » Image_Canvas » Bug #5786

Error in producing SVG

Details

Submitted2005-10-26 11:42 UTC
Fromp dot kirov at gmail dot com
Assignednosey
StatusClosed
PackageImage_Canvas
PHP Version4.4.0
OSLinux
Roadmaps(Not assigned)

Comments

[2005-10-26 11:42 UTC] p dot kirov at gmail dot com

Description:
------------
When generate SVG xml there is error on producing "id" in <g > tag, when there is "&" in plot title
I found
/usr/share/php/Image/Canvas/SVG.php on line 749
original:
$this->_addElement('<g id="' . $name . '">');
my fix:
$this->_addElement('<g id="' . str_replace( '&', '__', $name ) . '">');

Maybe this is not the best solution but it is work for now.

[2005-10-26 17:16 UTC] p dot kirov at gmail dot com

Thanks a lot for fast answer :). You are rigth htmlspecialchars() will be better solutiotion.