mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
This also fixes skipped tests due to different naming "zend-test" instead of "zend_test" and "PDO" instead of "pdo": - ext/dom/tests/libxml_global_state_entity_loader_bypass.phpt - ext/simplexml/tests/libxml_global_state_entity_loader_bypass.phpt - ext/xmlreader/tests/libxml_global_state_entity_loader_bypass.phpt - ext/zend_test/tests/observer_sqlite_create_function.phpt EXTENSIONS section is used for the Windows build to load the non-static extensions. Closes GH-13276
38 lines
848 B
PHP
38 lines
848 B
PHP
--TEST--
|
|
GHSA-3qrf-m4j2-pcrr (libxml global state entity loader bypass)
|
|
--EXTENSIONS--
|
|
libxml
|
|
xmlreader
|
|
zend_test
|
|
--SKIPIF--
|
|
<?php
|
|
if (!function_exists('zend_test_override_libxml_global_state')) die('skip not for Windows');
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
$xml = "<?xml version='1.0'?><!DOCTYPE root [<!ENTITY % bork SYSTEM \"php://nope\"> %bork;]><nothing/>";
|
|
|
|
libxml_use_internal_errors(true);
|
|
zend_test_override_libxml_global_state();
|
|
|
|
echo "--- String test ---\n";
|
|
$reader = XMLReader::xml($xml);
|
|
$reader->read();
|
|
echo "--- File test ---\n";
|
|
file_put_contents("libxml_global_state_entity_loader_bypass.tmp", $xml);
|
|
$reader = XMLReader::open("libxml_global_state_entity_loader_bypass.tmp");
|
|
$reader->read();
|
|
|
|
echo "Done\n";
|
|
|
|
?>
|
|
--CLEAN--
|
|
<?php
|
|
@unlink("libxml_global_state_entity_loader_bypass.tmp");
|
|
?>
|
|
--EXPECT--
|
|
--- String test ---
|
|
--- File test ---
|
|
Done
|