Skip to content

Commit 9d60dc1

Browse files
committed
Merge branch 'PHP-8.4'
* PHP-8.4: Fix test GH-16535 for libxml2 2.14 Fix tests for libxml2 2.14
2 parents 2862302 + 0918902 commit 9d60dc1

File tree

6 files changed

+12
-15
lines changed

6 files changed

+12
-15
lines changed

ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt

+4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ Verifies that an warning message is showed if an empty document is loaded
66
Antonio Diaz Ruiz <[email protected]>
77
--EXTENSIONS--
88
dom
9+
--SKIPIF--
10+
<?php
11+
if (LIBXML_VERSION >= 21400) die("skip libxml >= 2.14 no longer has this non-standard warning");
12+
?>
913
--FILE--
1014
<?php
1115
$doc = new DOMDocument();

ext/dom/tests/bug69679.phpt

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ $html = "<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body>U+0000 <s
99
$doc->loadHTML($html);
1010
print($doc->saveHTML());
1111
?>
12-
--EXPECT--
12+
--EXPECTF--
1313
<!DOCTYPE html>
14-
<html><head><meta charset="UTF-8"></head><body>U+0000 <span></span></body></html>
14+
<html><head><meta charset="UTF-8"></head><body>U+0000 <span>%r(&#65533;|)%r</span></body></html>

ext/dom/tests/bug78025.phpt

+1-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ dom
66
<?php
77
$htm = "<!DOCTYPE><html></html>";
88
$dom = new DOMDocument;
9-
$dom->loadHTML($htm);
9+
$dom->loadHTML($htm, LIBXML_NOERROR);
1010
var_dump($dom->doctype->name);
1111
?>
1212
--EXPECTF--
13-
Warning: DOMDocument::loadHTML(): htmlParseDocTypeDecl : no DOCTYPE name ! in Entity, line: 1 in %s on line %d
1413
string(0) ""

ext/dom/tests/bug80268_2.phpt

+2-5
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ if (LIBXML_VERSION < 20912) die('skip For libxml2 >= 2.9.12 only');
99
--FILE--
1010
<?php
1111
$doc = new DOMDocument;
12-
$doc->loadHTML("<p>foo\0bar</p>");
12+
$doc->loadHTML("<p>foo\0bar</p>", LIBXML_NOERROR);
1313
$html = $doc->saveHTML();
1414
var_dump(strpos($html, '<p>foo</p>') !== false);
1515

1616
file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
1717
$doc = new DOMDocument;
18-
$doc->loadHTMLFile(__DIR__ . '/80268.html');
18+
$doc->loadHTMLFile(__DIR__ . '/80268.html', LIBXML_NOERROR);
1919
$html = $doc->saveHTML();
2020
var_dump(strpos($html, '<p>foo</p>') !== false);
2121
?>
@@ -24,8 +24,5 @@ var_dump(strpos($html, '<p>foo</p>') !== false);
2424
unlink(__DIR__ . '/80268.html');
2525
?>
2626
--EXPECTF--
27-
Warning: DOMDocument::loadHTML(): Char 0x0 out of allowed range in Entity, line: 1 in %s on line %d
2827
bool(false)
29-
30-
Warning: DOMDocument::loadHTMLFile(): Char 0x0 out of allowed range in %s on line %d
3128
bool(false)

ext/dom/tests/gh16535.phpt

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ try {
1414
} catch (DOMException $e) {
1515
echo $e->getMessage(), "\n";
1616
}
17-
$v2->loadHTML("oU");
17+
$v2->loadHTML("<p>oU</p>");
1818
echo $v2->saveXML();
1919

2020
?>

ext/simplexml/tests/bug51615.phpt

+2-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ dom
77
<?php
88

99
$dom = new DOMDocument;
10-
$dom->loadHTML('<span title=""y">x</span><span title=""z">x</span>');
10+
$dom->loadHTML('<span title=""y">x</span><span title=""z">x</span>', LIBXML_NOERROR);
1111
$html = simplexml_import_dom($dom);
1212

1313
var_dump($html->body->span);
@@ -18,15 +18,12 @@ foreach ($html->body->span as $obj) {
1818

1919
?>
2020
--EXPECTF--
21-
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
22-
23-
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
2421
object(SimpleXMLElement)#%d (3) {
2522
["@attributes"]=>
2623
array(2) {
2724
["title"]=>
2825
string(0) ""
29-
["y"]=>
26+
[%r("y"{1,2})%r]=>
3027
string(0) ""
3128
}
3229
[0]=>

0 commit comments

Comments
 (0)