summaryrefslogtreecommitdiff
path: root/ext/dom/tests/bug80268.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dom/tests/bug80268.phpt')
-rw-r--r--ext/dom/tests/bug80268.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/dom/tests/bug80268.phpt b/ext/dom/tests/bug80268.phpt
new file mode 100644
index 0000000000..0fe50b85e8
--- /dev/null
+++ b/ext/dom/tests/bug80268.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #80268 (loadHTML() truncates at NUL bytes)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
+--FILE--
+<?php
+$doc = new DOMDocument;
+$doc->loadHTML("<p>foo\0bar</p>");
+$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');
+$html = $doc->saveHTML();
+var_dump(strpos($html, '<p>foo</p>') !== false);
+?>
+--CLEAN--
+<?php
+unlink(__DIR__ . '/80268.html');
+?>
+--EXPECT--
+bool(true)
+bool(true)