MediaWiki REL1_30
PhpBugTests.php
Go to the documentation of this file.
1<?php
31 private $parsedData = '';
32 public $ok = false;
33
34 public function __construct() {
35 $charData = '<b>c</b>';
36 $xml = '<a>' . htmlspecialchars( $charData ) . '</a>';
37
38 $parser = xml_parser_create();
39 xml_set_character_data_handler( $parser, [ $this, 'chardata' ] );
40 $parsedOk = xml_parse( $parser, $xml, true );
41 $this->ok = $parsedOk && ( $this->parsedData == $charData );
42 }
43
44 public function chardata( $parser, $data ) {
45 $this->parsedData .= $data;
46 }
47}
Test for PHP+libxml2 bug which breaks XML input subtly with certain versions.
chardata( $parser, $data)
do that in ParserLimitReportFormat instead $parser
Definition hooks.txt:2572