On Fri, 9 Dec 2011, Brion Vibber wrote:
Your system has a combination of PHP and libxml2 versions which is buggy and can cause hidden data corruption in MediaWiki and other web apps. Upgrade to PHP 5.2.9 or later and libxml2 2.7.3 or later! ABORTING (see http://bugs.php.net/bug.php?id=45996).
But my versions are quite new:
<?php class PhpXmlBugTester { private $parsedData = ''; public $ok = false; public function __construct() { $charData = '<b>c</b>'; $xml = '<a>' . htmlspecialchars( $charData ) . '</a>'; $parser = xml_parser_create(); xml_set_character_data_handler( $parser, array( $this, 'chardata' ) ); $parsedOk = xml_parse( $parser, $xml, true ); $this->ok = $parsedOk && ( $this->parsedData == $charData ); print "<pre>\n"; print "Got: " . htmlspecialchars($this->parsedData) . "\n"; print "Expected: " . htmlspecialchars($charData) . "\n"; print "</pre>\n"; } public function chardata( $parser, $data ) { $this->parsedData .= $data; } } $a = new PhpXmlBugTester(); ?>
It should show:
Got: <b>c</b> Expected: <b>c</b>
if all is well.
If it shows "Got: bcb" then I believe that's an example of this particular
Funny, the result is:
<pre> Got: bc/b Expected: <b>c</b> </pre>
Cheers, Marlen