diff options
Diffstat (limited to 'plugins/af_comics/filters')
-rw-r--r-- | plugins/af_comics/filters/af_comics_cad.php | 9 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_comicclass.php | 2 | ||||
-rwxr-xr-x | plugins/af_comics/filters/af_comics_comicpress.php | 2 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_darklegacy.php | 8 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_dilbert.php | 8 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_gocomics.php | 2 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_gocomics_farside.php | 2 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_pa.php | 4 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_pvp.php | 2 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_tfd.php | 4 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_twp.php | 4 | ||||
-rw-r--r-- | plugins/af_comics/filters/af_comics_whomp.php | 8 |
12 files changed, 26 insertions, 29 deletions
diff --git a/plugins/af_comics/filters/af_comics_cad.php b/plugins/af_comics/filters/af_comics_cad.php index 5da82ae3f..b2b65ee05 100644 --- a/plugins/af_comics/filters/af_comics_cad.php +++ b/plugins/af_comics/filters/af_comics_cad.php @@ -8,19 +8,16 @@ class Af_Comics_Cad extends Af_ComicFilter { function process(&$article) { if (strpos($article["link"], "cad-comic.com") !== false) { if (strpos($article["title"], "News:") === false) { - - global $fetch_last_error_content; - $doc = new DOMDocument(); $res = UrlHelper::fetch($article["link"], false, false, false, false, false, 0, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"); - if (!$res && $fetch_last_error_content) - $res = $fetch_last_error_content; + if (!$res && UrlHelper::$fetch_last_error_content) + $res = UrlHelper::$fetch_last_error_content; - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//div[@class="comicpage"]/a/img')->item(0); diff --git a/plugins/af_comics/filters/af_comics_comicclass.php b/plugins/af_comics/filters/af_comics_comicclass.php index ff32375d3..5e14ea930 100644 --- a/plugins/af_comics/filters/af_comics_comicclass.php +++ b/plugins/af_comics/filters/af_comics_comicclass.php @@ -17,7 +17,7 @@ class Af_Comics_ComicClass extends Af_ComicFilter { $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//div[@class="comic"]')->item(0); diff --git a/plugins/af_comics/filters/af_comics_comicpress.php b/plugins/af_comics/filters/af_comics_comicpress.php index 29b064612..741d59672 100755 --- a/plugins/af_comics/filters/af_comics_comicpress.php +++ b/plugins/af_comics/filters/af_comics_comicpress.php @@ -23,7 +23,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter { $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//div[@id="comic"]')->item(0); diff --git a/plugins/af_comics/filters/af_comics_darklegacy.php b/plugins/af_comics/filters/af_comics_darklegacy.php index 978545431..d1f6016cb 100644 --- a/plugins/af_comics/filters/af_comics_darklegacy.php +++ b/plugins/af_comics/filters/af_comics_darklegacy.php @@ -13,14 +13,12 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter { false, false, 0, "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"); - global $fetch_last_error_content; - - if (!$res && $fetch_last_error_content) - $res = $fetch_last_error_content; + if (!$res && UrlHelper::$fetch_last_error_content) + $res = UrlHelper::$fetch_last_error_content; $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//div[@class="comic"]')->item(0); diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php index 31a72d88d..49fa54cfa 100644 --- a/plugins/af_comics/filters/af_comics_dilbert.php +++ b/plugins/af_comics/filters/af_comics_dilbert.php @@ -14,14 +14,12 @@ class Af_Comics_Dilbert extends Af_ComicFilter { false, false, 0, "Mozilla/5.0 (Windows NT 6.1; WOW64; rv:50.0) Gecko/20100101 Firefox/50.0"); - global $fetch_last_error_content; - - if (!$res && $fetch_last_error_content) - $res = $fetch_last_error_content; + if (!$res && UrlHelper::$fetch_last_error_content) + $res = UrlHelper::$fetch_last_error_content; $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); // Get the image container diff --git a/plugins/af_comics/filters/af_comics_gocomics.php b/plugins/af_comics/filters/af_comics_gocomics.php index 6c5c7c0d3..71d387918 100644 --- a/plugins/af_comics/filters/af_comics_gocomics.php +++ b/plugins/af_comics/filters/af_comics_gocomics.php @@ -40,7 +40,7 @@ class Af_Comics_Gocomics extends Af_ComicFilter { $tpl->readTemplateFromFile('templates/generated_feed.txt'); $tpl->setVariable('FEED_TITLE', $feed_title, true); - $tpl->setVariable('VERSION', get_version(), true); + $tpl->setVariable('VERSION', Config::get_version(), true); $tpl->setVariable('FEED_URL', htmlspecialchars($url), true); $tpl->setVariable('SELF_URL', $site_url, true); diff --git a/plugins/af_comics/filters/af_comics_gocomics_farside.php b/plugins/af_comics/filters/af_comics_gocomics_farside.php index 89322209d..0399015ab 100644 --- a/plugins/af_comics/filters/af_comics_gocomics_farside.php +++ b/plugins/af_comics/filters/af_comics_gocomics_farside.php @@ -33,7 +33,7 @@ class Af_Comics_Gocomics_FarSide extends Af_ComicFilter { $tpl->readTemplateFromFile('templates/generated_feed.txt'); $tpl->setVariable('FEED_TITLE', "The Far Side", true); - $tpl->setVariable('VERSION', get_version(), true); + $tpl->setVariable('VERSION', Config::get_version(), true); $tpl->setVariable('FEED_URL', htmlspecialchars($url), true); $tpl->setVariable('SELF_URL', htmlspecialchars($url), true); diff --git a/plugins/af_comics/filters/af_comics_pa.php b/plugins/af_comics/filters/af_comics_pa.php index 380e84596..a5a81edcb 100644 --- a/plugins/af_comics/filters/af_comics_pa.php +++ b/plugins/af_comics/filters/af_comics_pa.php @@ -25,7 +25,9 @@ class Af_Comics_Pa extends Af_ComicFilter { if (strpos($article["link"], "penny-arcade.com") !== false && strpos($article["title"], "News Post:") !== false) { $doc = new DOMDocument(); - if ($doc->loadHTML(UrlHelper::fetch($article["link"]))) { + $res = UrlHelper::fetch($article["link"]); + + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $entries = $xpath->query('(//div[@class="post"])'); diff --git a/plugins/af_comics/filters/af_comics_pvp.php b/plugins/af_comics/filters/af_comics_pvp.php index 105d3f490..a27fbca87 100644 --- a/plugins/af_comics/filters/af_comics_pvp.php +++ b/plugins/af_comics/filters/af_comics_pvp.php @@ -14,7 +14,7 @@ class Af_Comics_Pvp extends Af_ComicFilter { $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//section[@class="comic-art"]')->item(0); diff --git a/plugins/af_comics/filters/af_comics_tfd.php b/plugins/af_comics/filters/af_comics_tfd.php index e0216705c..19ca43a24 100644 --- a/plugins/af_comics/filters/af_comics_tfd.php +++ b/plugins/af_comics/filters/af_comics_tfd.php @@ -16,7 +16,9 @@ class Af_Comics_Tfd extends Af_ComicFilter { $doc = new DOMDocument(); - if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) { + $res = UrlHelper::fetch($article["link"]); + + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0); diff --git a/plugins/af_comics/filters/af_comics_twp.php b/plugins/af_comics/filters/af_comics_twp.php index 38a8ca32b..6715be3c2 100644 --- a/plugins/af_comics/filters/af_comics_twp.php +++ b/plugins/af_comics/filters/af_comics_twp.php @@ -11,7 +11,9 @@ class Af_Comics_Twp extends Af_ComicFilter { $doc = new DOMDocument(); - if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) { + $res = UrlHelper::fetch($article["link"]); + + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXpath($doc); $basenode = $xpath->query("//td/center/img")->item(0); diff --git a/plugins/af_comics/filters/af_comics_whomp.php b/plugins/af_comics/filters/af_comics_whomp.php index 021a2952a..712388449 100644 --- a/plugins/af_comics/filters/af_comics_whomp.php +++ b/plugins/af_comics/filters/af_comics_whomp.php @@ -12,14 +12,12 @@ class Af_Comics_Whomp extends Af_ComicFilter { false, false, 0, "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)"); - global $fetch_last_error_content; - - if (!$res && $fetch_last_error_content) - $res = $fetch_last_error_content; + if (!$res && UrlHelper::$fetch_last_error_content) + $res = UrlHelper::$fetch_last_error_content; $doc = new DOMDocument(); - if (@$doc->loadHTML($res)) { + if ($res && $doc->loadHTML($res)) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//img[@id="cc-comic"]')->item(0); |