From afc7142250dc02654a53a7222abe88df964d58f4 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 28 Feb 2021 10:12:57 +0300 Subject: move all $fetch globals to UrlHelper --- plugins/af_comics/filters/af_comics_cad.php | 7 ++----- plugins/af_comics/filters/af_comics_darklegacy.php | 6 ++---- plugins/af_comics/filters/af_comics_dilbert.php | 6 ++---- plugins/af_comics/filters/af_comics_whomp.php | 6 ++---- 4 files changed, 8 insertions(+), 17 deletions(-) (limited to 'plugins/af_comics/filters') diff --git a/plugins/af_comics/filters/af_comics_cad.php b/plugins/af_comics/filters/af_comics_cad.php index 5da82ae3f..0f5bb52fa 100644 --- a/plugins/af_comics/filters/af_comics_cad.php +++ b/plugins/af_comics/filters/af_comics_cad.php @@ -8,17 +8,14 @@ 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)) { $xpath = new DOMXPath($doc); diff --git a/plugins/af_comics/filters/af_comics_darklegacy.php b/plugins/af_comics/filters/af_comics_darklegacy.php index 978545431..359c56443 100644 --- a/plugins/af_comics/filters/af_comics_darklegacy.php +++ b/plugins/af_comics/filters/af_comics_darklegacy.php @@ -13,10 +13,8 @@ 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(); diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php index 31a72d88d..00aad78f2 100644 --- a/plugins/af_comics/filters/af_comics_dilbert.php +++ b/plugins/af_comics/filters/af_comics_dilbert.php @@ -14,10 +14,8 @@ 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(); diff --git a/plugins/af_comics/filters/af_comics_whomp.php b/plugins/af_comics/filters/af_comics_whomp.php index 021a2952a..f218890d7 100644 --- a/plugins/af_comics/filters/af_comics_whomp.php +++ b/plugins/af_comics/filters/af_comics_whomp.php @@ -12,10 +12,8 @@ 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(); -- cgit v1.2.3