From: Andrew Dolgov <noreply@fakecake.org>
Date: Thu, 18 Jun 2015 05:28:54 +0000 (+0300)
Subject: fix toothpastefordinner valiant efforts to prevent scraping
X-Git-Tag: 16.3~286
X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=5613bb3584356e51e5e476484d6e8b38210707d4;p=tt-rss.git

fix toothpastefordinner valiant efforts to prevent scraping
---

diff --git a/plugins/af_comics/filters/af_comics_tfd.php b/plugins/af_comics/filters/af_comics_tfd.php
index c4e59455..d47c164e 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;