note 86664 rejected from function.xml-parse-into-struct by thiago
| From: | thiago@php.net | Date: | Wed, 29 Oct 2008 01:27:09 +0000 |
| Subject: | note 86664 rejected from function.xml-parse-into-struct by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-145914@lists.php.net to get a copy of this message | ||
Note Submitter: toto at yahoo dot com
----
The parser has a bug :
when you parse
<a foo="<bar> ... </bar>">
the parser try to parse the argument of foo.
To solve this replace by urlencode
$r = xml_parse_into_struct($parser,
preg_replace_callback('/"([^"]*)"/',
create_function('$match', 'return(\'"\' .
urlencode($match[1]) . \'"\');'),
$xml_string
),
$vals,
$index);
The apply urldecode when it's needed