psliwa / PHPPdf

Pdf and graphic files generator library written in php
http://ohey.pl
MIT License
339 stars 77 forks source link

Xml parsing error Char 0x0 out of allowed range #99

Open archie18 opened 9 years ago

archie18 commented 9 years ago

I encountered a problem with user data containing a NUL character (0x0) and the XmlParser throws the following exception:

[1] PHPPdf\Parser\Exception\ParseException: Xml parsing error "Char 0x0 out of allowed range
" in file "/Library/WebServer/Documents/Postgrado/web/" on line 126 on column 1063
    at n/a
        in /Library/WebServer/Documents/Postgrado/vendor/psliwa/php-pdf/lib/PHPPdf/Parser/XmlParser.php line 121

    at PHPPdf\Parser\XmlParser->read(object(XMLReader))
        in /Library/WebServer/Documents/Postgrado/vendor/psliwa/php-pdf/lib/PHPPdf/Parser/XmlParser.php line 59

    at PHPPdf\Parser\XmlParser->parse('...')

What would be the recommended way to sanitize my XML data?

Best, Andreas

aledeg commented 8 years ago

Could you post your XML so we can reproduce the error?