1--TEST-- 2Bug #80268 (loadHTML() truncates at NUL bytes) 3--EXTENSIONS-- 4dom 5--SKIPIF-- 6<?php 7if (LIBXML_VERSION >= 20912) die('skip For libxml2 < 2.9.12 only'); 8?> 9--FILE-- 10<?php 11$doc = new DOMDocument; 12$doc->loadHTML("<p>foo\0bar</p>"); 13$html = $doc->saveHTML(); 14var_dump(strpos($html, '<p>foo</p>') !== false); 15 16file_put_contents(__DIR__ . '/80268.html', "<p>foo\0bar</p>"); 17$doc = new DOMDocument; 18$doc->loadHTMLFile(__DIR__ . '/80268.html'); 19$html = $doc->saveHTML(); 20var_dump(strpos($html, '<p>foo</p>') !== false); 21?> 22--CLEAN-- 23<?php 24unlink(__DIR__ . '/80268.html'); 25?> 26--EXPECT-- 27bool(true) 28bool(true) 29