note 63786 deleted from function.xml-parser-create by bjori
| From: | bjori@php.net | Date: | Thu, 30 Mar 2006 17:37:45 +0000 |
| Subject: | note 63786 deleted from function.xml-parser-create by bjori | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-107047@lists.php.net to get a copy of this message | ||
Note Submitter: benbakelaar at gmail dot com
Reason: bad code
----
keyword: XML PHP parser error on line 1
after a grand struggle, the answer to my problem was simply:
stripslashes()
when XML content gets transferred via HTML through a POST, " and ' becomes \" and
\'.
xml_parser_create then does not locate the header of the XML string variable, and you get XML error:
something whatever line 1.
so grab your POSTed variable, but before you send it to your parser (if you are using a freely
available user-created function such as xmlize() or something, chances are still they are within the
function using xml_parser_create), make sure you run this:
stripslashes($_POST["xmlvariable"]);