Check for HTML in the first 100 bytes.

Some HTML pages have an XML header (XHTML), which alone is nearly 50 bytes.
Thus we need to check for the HTML or doctype tags in the first 100 bytes.
This commit is contained in:
Christian Weiske 2015-07-09 13:39:07 +02:00
parent 12d880d77a
commit 5a4074a9f8
1 changed files with 1 additions and 1 deletions

View File

@ -1792,7 +1792,7 @@
}
function is_html($content) {
return preg_match("/<html|DOCTYPE html/i", substr($content, 0, 20)) !== 0;
return preg_match("/<html|DOCTYPE html/i", substr($content, 0, 100)) !== 0;
}
function url_is_html($url, $login = false, $pass = false) {