Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ext/dom/tests/DOMDocument_loadHTMLfile_variation1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Verifies that an warning message is showed if an empty document is loaded
Antonio Diaz Ruiz <[email protected]>
--EXTENSIONS--
dom
--SKIPIF--
<?php
if (LIBXML_VERSION >= 21400) die("skip libxml >= 2.14 no longer has this non-standard warning");
?>
--FILE--
<?php
$doc = new DOMDocument();
Expand Down
4 changes: 2 additions & 2 deletions ext/dom/tests/bug69679.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ $html = "<!DOCTYPE html><html><head><meta charset='UTF-8'></head><body>U+0000 <s
$doc->loadHTML($html);
print($doc->saveHTML());
?>
--EXPECT--
--EXPECTF--
<!DOCTYPE html>
<html><head><meta charset="UTF-8"></head><body>U+0000 <span></span></body></html>
<html><head><meta charset="UTF-8"></head><body>U+0000 <span>%r(&#65533;|)%r</span></body></html>
3 changes: 1 addition & 2 deletions ext/dom/tests/bug78025.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ dom
<?php
$htm = "<!DOCTYPE><html></html>";
$dom = new DOMDocument;
$dom->loadHTML($htm);
$dom->loadHTML($htm, LIBXML_NOERROR);
var_dump($dom->doctype->name);
?>
--EXPECTF--
Warning: DOMDocument::loadHTML(): htmlParseDocTypeDecl : no DOCTYPE name ! in Entity, line: 1 in %s on line %d
string(0) ""
7 changes: 2 additions & 5 deletions ext/dom/tests/bug80268_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ if (LIBXML_VERSION < 20912) die('skip For libxml2 >= 2.9.12 only');
--FILE--
<?php
$doc = new DOMDocument;
$doc->loadHTML("<p>foo\0bar</p>");
$doc->loadHTML("<p>foo\0bar</p>", LIBXML_NOERROR);
$html = $doc->saveHTML();
var_dump(strpos($html, '<p>foo</p>') !== false);

file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>");
$doc = new DOMDocument;
$doc->loadHTMLFile(__DIR__ . '/80268.html');
$doc->loadHTMLFile(__DIR__ . '/80268.html', LIBXML_NOERROR);
$html = $doc->saveHTML();
var_dump(strpos($html, '<p>foo</p>') !== false);
?>
Expand All @@ -24,8 +24,5 @@ var_dump(strpos($html, '<p>foo</p>') !== false);
unlink(__DIR__ . '/80268.html');
?>
--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)
2 changes: 1 addition & 1 deletion ext/dom/tests/gh16535.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ try {
} catch (DOMException $e) {
echo $e->getMessage(), "\n";
}
$v2->loadHTML("oU");
$v2->loadHTML("<p>oU</p>");
echo $v2->saveXML();

?>
Expand Down
7 changes: 2 additions & 5 deletions ext/simplexml/tests/bug51615.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ dom
<?php

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

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

?>
--EXPECTF--
Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d

Warning: DOMDocument::loadHTML(): error parsing attribute name in Entity, line: 1 in %s on line %d
object(SimpleXMLElement)#%d (3) {
["@attributes"]=>
array(2) {
["title"]=>
string(0) ""
["y"]=>
[%r("y"{1,2})%r]=>
string(0) ""
}
[0]=>
Expand Down
Loading