af_readability: specify http accept header

This commit is contained in:
Andrew Dolgov 2018-05-25 14:35:33 +03:00
parent 68d9c412ea
commit b037ffd628

View file

@ -141,7 +141,10 @@ class Af_Readability extends Plugin {
if (!class_exists("Readability")) require_once(dirname(dirname(__DIR__)). "/lib/readability/Readability.php"); if (!class_exists("Readability")) require_once(dirname(dirname(__DIR__)). "/lib/readability/Readability.php");
$tmp = fetch_file_contents(array("url" => $url, "type" => "text/html")); $tmp = fetch_file_contents([
"url" => $url,
"http_accept" => "text/*",
"type" => "text/html"]);
if ($tmp && mb_strlen($tmp) < 1024 * 500) { if ($tmp && mb_strlen($tmp) < 1024 * 500) {
$tmpdoc = new DOMDocument("1.0", "UTF-8"); $tmpdoc = new DOMDocument("1.0", "UTF-8");