diff --git a/ext/dom/tests/DOMDocument_loadXML_error1.phpt b/ext/dom/tests/DOMDocument_loadXML_error1.phpt index 7ab878ae450c2..14d99e4ed9ad9 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error1.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error1.phpt @@ -21,6 +21,6 @@ domdocumentloadxml_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s -Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s +Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line (4|5) and books%r %s Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found in Entity, line: 13%r %s diff --git a/ext/dom/tests/DOMDocument_load_error1.phpt b/ext/dom/tests/DOMDocument_load_error1.phpt index ab1caccf73a8e..f736b0a0e81c6 100644 --- a/ext/dom/tests/DOMDocument_load_error1.phpt +++ b/ext/dom/tests/DOMDocument_load_error1.phpt @@ -21,6 +21,6 @@ domdocumentload_test_method.inc --EXPECTF-- Warning: DOMDocument::load%r(XML){0,1}%r(): Opening and ending tag mismatch: title line 5 and book %s -Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line 5 and books%r %s +Warning: DOMDocument::load%r(XML){0,1}%r(): %rexpected '>'|Opening and ending tag mismatch: book line (4|5) and books%r %s Warning: DOMDocument::load%r(XML){0,1}%r(): %rPremature end of data in tag books|EndTag: '<\/' not found%r %s diff --git a/ext/dom/tests/bug43364.phpt b/ext/dom/tests/bug43364.phpt index 68e030c20fc38..ea7b52742e2a3 100644 --- a/ext/dom/tests/bug43364.phpt +++ b/ext/dom/tests/bug43364.phpt @@ -36,7 +36,7 @@ $doc->xinclude(); $count = loopElements(array($doc->documentElement)); -var_dump($count); +var_dump($count == 13 || $count == 11); ?> --EXPECT-- -int(13) +bool(true) diff --git a/ext/dom/tests/bug80268.phpt b/ext/dom/tests/bug80268.phpt index 313cf70a37e26..c5d3cfe270f70 100644 --- a/ext/dom/tests/bug80268.phpt +++ b/ext/dom/tests/bug80268.phpt @@ -2,6 +2,10 @@ Bug #80268 (loadHTML() truncates at NUL bytes) --EXTENSIONS-- dom +--SKIPIF-- += 20912) die('skip For libxml2 < 2.9.12 only'); +?> --FILE-- = 2.9.12 only'); +?> +--FILE-- +loadHTML("
foo\0bar
"); +$html = $doc->saveHTML(); +var_dump(strpos($html, 'foo
') !== false); + +file_put_contents(__DIR__ . '/80268.html', "foo\0bar
"); +$doc = new DOMDocument; +$doc->loadHTMLFile(__DIR__ . '/80268.html'); +$html = $doc->saveHTML(); +var_dump(strpos($html, 'foo
') !== false); +?> +--CLEAN-- + +--EXPECTF-- +Warning: DOMDocument::loadHTML(): Char 0x0 out of allowed range in Entity, line: 1 in %s on line %d +bool(false) + +Warning: DOMDocument::loadHTMLFile(): Char 0x0 out of allowed range in %s on line %d +bool(false) diff --git a/ext/libxml/tests/bug61367-read.phpt b/ext/libxml/tests/bug61367-read.phpt index 959b404954bd7..441a162a57538 100644 --- a/ext/libxml/tests/bug61367-read.phpt +++ b/ext/libxml/tests/bug61367-read.phpt @@ -1,7 +1,10 @@ --TEST-- Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test --SKIPIF-- - += 20912) die('skip For libxml2 < 2.9.12 only'); +?> --INI-- open_basedir=. --FILE-- diff --git a/ext/libxml/tests/bug61367-read_2.phpt b/ext/libxml/tests/bug61367-read_2.phpt new file mode 100644 index 0000000000000..ed6576aa752ed --- /dev/null +++ b/ext/libxml/tests/bug61367-read_2.phpt @@ -0,0 +1,60 @@ +--TEST-- +Bug #61367: open_basedir bypass in libxml RSHUTDOWN: read test +--SKIPIF-- += 2.9.12 only'); +?> +--INI-- +open_basedir=. +--FILE-- +resolveExternals = true; + $doc->substituteEntities = true; + $dir = htmlspecialchars(dirname(getcwd())); + $dir = str_replace('\\', '/', $dir); // fix for windows + $doc->loadXML( <<