Bug #68188 [Opn->Nab]: Imagick can't display "<" and "&"
| From: | tyrael@php.net | Date: | Fri, 17 Oct 2014 13:13:49 +0000 |
| Subject: | Bug #68188 [Opn->Nab]: Imagick can't display "<" and "&" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-188159@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=68188&edit=1
ID: 68188
Updated by: tyrael@php.net
Reported by: martin dot schmitz at uni-bielefeld dot de
Summary: Imagick can't display "<" and "&"
-Status: Open
+Status: Not a bug
Type: Bug
Package: Unknown/Other Function
Operating System: Linux 64Bit Mageia 5
PHP Version: 5.6.1
Block user comment: N
Private report: N
New Comment:
from what I can tell, you are generating invalid xml.
either use CDATA or htmlspecialchars if you want to put arbitrary strings into your svg xml.
Previous Comments:
------------------------------------------------------------------------
[2014-10-08 14:29:54] martin dot schmitz at uni-bielefeld dot de
Description:
------------
---
From manual page: http://www.php.net/class.imagick
---
$im = new Imagick();
$svg = '<?xml version="1.0" encoding="UTF-8"?>';
$svg .= '<svg style="width:240; height:240;" version="1.1">';
$svg .= svg_figure();
$svg .= '</svg>';
$im->readImageBlob ($svg);
$im->setImageFormat ($_REQUEST['type']);
$im->paintTransparentImage ($im->getImagePixelColor (0, 0), 0, 0);
echo $im;
function svg_figure($char){
return '<svg>
<text id="letter" x="5" y="14"><tspan
style="font-family:Arial, Helvetica, sans-serif; font-size:20pt;"
>'.chr($char).'</tspan></text>
</svg>';
}
I run (code are just relevant sniplets) svg_figure() through various aasci-codes. All (printable)
characters are printed fine except "<" and "&".
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=68188&edit=1