summaryrefslogtreecommitdiff
path: root/plugins/af_comics/filters/af_comics_tfd.php
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2015-06-18 08:28:54 +0300
committerAndrew Dolgov <[email protected]>2015-06-18 08:28:54 +0300
commit5613bb3584356e51e5e476484d6e8b38210707d4 (patch)
tree0f09dda3070d64d31d39146ba7b4f0cd242af508 /plugins/af_comics/filters/af_comics_tfd.php
parent6c9f3d4a6002e23d15e4d518cd0ed5aea25229bd (diff)
fix toothpastefordinner valiant efforts to prevent scraping
Diffstat (limited to 'plugins/af_comics/filters/af_comics_tfd.php')
-rw-r--r--plugins/af_comics/filters/af_comics_tfd.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/af_comics/filters/af_comics_tfd.php b/plugins/af_comics/filters/af_comics_tfd.php
index c4e594551..d47c164ee 100644
--- a/plugins/af_comics/filters/af_comics_tfd.php
+++ b/plugins/af_comics/filters/af_comics_tfd.php
@@ -6,12 +6,15 @@ class Af_Comics_Tfd extends Af_ComicFilter {
}
function process(&$article) {
- $owner_uid = $article["owner_uid"];
-
if (strpos($article["link"], "toothpastefordinner.com") !== FALSE) {
- $doc = new DOMDocument();
+ $res = fetch_file_contents($article["link"], false, false, false,
+ false, false, 0,
+ "Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; WOW64; Trident/6.0)");
- @$doc->loadHTML(fetch_file_contents($article["link"]));
+ if (!$res) return $article;
+
+ $doc = new DOMDocument();
+ $doc->loadHTML($res);
$basenode = false;