--TEST-- Bug #80268 (loadHTML() truncates at NUL bytes) --EXTENSIONS-- dom --SKIPIF-- = 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)