MediaWiki  REL1_24
PhpBugTests.php
Go to the documentation of this file.
00001 <?php
00030 class PhpXmlBugTester {
00031     private $parsedData = '';
00032     public $ok = false;
00033 
00034     public function __construct() {
00035         $charData = '<b>c</b>';
00036         $xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
00037 
00038         $parser = xml_parser_create();
00039         xml_set_character_data_handler( $parser, array( $this, 'chardata' ) );
00040         $parsedOk = xml_parse( $parser, $xml, true );
00041         $this->ok = $parsedOk && ( $this->parsedData == $charData );
00042     }
00043 
00044     public function chardata( $parser, $data ) {
00045         $this->parsedData .= $data;
00046     }
00047 }