From 98ed3be52fa15521ef405fc8029176279d80778e Mon Sep 17 00:00:00 2001 From: Julien Voisin Date: Thu, 24 Dec 2020 10:32:28 +0000 Subject: Add PHP8 support --- src/tests/xxe/disable_xxe_xml_parse_php8.phpt | 106 -------------------------- 1 file changed, 106 deletions(-) delete mode 100644 src/tests/xxe/disable_xxe_xml_parse_php8.phpt (limited to 'src/tests/xxe/disable_xxe_xml_parse_php8.phpt') diff --git a/src/tests/xxe/disable_xxe_xml_parse_php8.phpt b/src/tests/xxe/disable_xxe_xml_parse_php8.phpt deleted file mode 100644 index 4a8622a..0000000 --- a/src/tests/xxe/disable_xxe_xml_parse_php8.phpt +++ /dev/null @@ -1,106 +0,0 @@ ---TEST-- -Disable XXE in xml_parse, in php8 ---SKIPIF-- - - ---EXTENSIONS-- -xml ---INI-- -sp.configuration_file={PWD}/config/disable_xxe.ini ---FILE-- - - -]> -&foo; -EOD; - -file_put_contents('content.xml', $xml); - -function create_parser() { - $parser = xml_parser_create(); - xml_set_element_handler( - $parser, - function($parser, $name, array $attributes) { - var_dump($name); - echo "\n"; - var_dump($attributes); - }, - function($parser, $name) { - var_dump($name); - } - ); - - xml_set_character_data_handler( - $parser, - function ($parser, $text){ - echo 'text' . $text; - } - ); - - return $parser; -} - -libxml_disable_entity_loader(true); -$parser = create_parser(); -$doc = xml_parse($parser, $xml, true); -xml_parser_free($parser); - -libxml_disable_entity_loader(false); -$parser = create_parser(); -$doc = xml_parse($parser, $xml, true); -xml_parser_free($parser); - -$xml = "foo"; -file_put_contents('content.xml', $xml); -$parser = create_parser(); -$doc = xml_parse($parser, $xml, true); -xml_parser_free($parser); - ---EXPECTF-- - Deprecated: Function libxml_disable_entity_loader() is deprecated in %s/tests/xxe/disable_xxe_xml_parse.php on line 41 -string(4) "TEST" - -array(0) { -} -string(7) "TESTING" - -array(0) { -} -string(7) "TESTING" -string(4) "TEST" - -Deprecated: Function libxml_disable_entity_loader() is deprecated in %s/tests/xxe/disable_xxe_xml_parse.php on line 46 -string(4) "TEST" - -array(0) { -} -string(7) "TESTING" - -array(0) { -} -string(7) "TESTING" -string(4) "TEST" -string(4) "TEST" - -array(0) { -} -string(7) "TESTING" - -array(0) { -} -textfoostring(7) "TESTING" - -- cgit v1.3