fix dilbert plugin not working because of changed GUIDs or w/e

This commit is contained in:
Andrew Dolgov 2017-06-05 10:28:59 +03:00
parent 2816d2cd4b
commit 1d61994776
1 changed files with 2 additions and 5 deletions

View File

@ -7,7 +7,7 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
} }
function process(&$article) { function process(&$article) {
if (strpos($article["guid"], "dilbert.com") !== FALSE || if (strpos($article["link"], "dilbert.com") !== FALSE ||
strpos($article["link"], "/DilbertDailyStrip") !== FALSE) { strpos($article["link"], "/DilbertDailyStrip") !== FALSE) {
$res = fetch_file_contents($article["link"], false, false, false, $res = fetch_file_contents($article["link"], false, false, false,
@ -20,11 +20,8 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
$res = $fetch_last_error_content; $res = $fetch_last_error_content;
$doc = new DOMDocument(); $doc = new DOMDocument();
@$doc->loadHTML($res);
$basenode = false; if (@$doc->loadHTML($res)) {
if ($doc) {
$xpath = new DOMXPath($doc); $xpath = new DOMXPath($doc);
// Get the image container // Get the image container