af_comics filters: don't try to load empty html
This commit is contained in:
parent
bc2953b5e7
commit
c8883d3440
|
@ -17,7 +17,7 @@ class Af_Comics_Cad extends Af_ComicFilter {
|
||||||
if (!$res && UrlHelper::$fetch_last_error_content)
|
if (!$res && UrlHelper::$fetch_last_error_content)
|
||||||
$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);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//div[@class="comicpage"]/a/img')->item(0);
|
$basenode = $xpath->query('//div[@class="comicpage"]/a/img')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Af_Comics_ComicClass extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
|
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,7 @@ class Af_Comics_ComicPress extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//div[@id="comic"]')->item(0);
|
$basenode = $xpath->query('//div[@id="comic"]')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class Af_Comics_DarkLegacy extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
|
$basenode = $xpath->query('//div[@class="comic"]')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -19,7 +19,7 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
|
|
||||||
// Get the image container
|
// Get the image container
|
||||||
|
|
|
@ -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) {
|
if (strpos($article["link"], "penny-arcade.com") !== false && strpos($article["title"], "News Post:") !== false) {
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if ($doc->loadHTML(UrlHelper::fetch($article["link"]))) {
|
$res = UrlHelper::fetch($article["link"]);
|
||||||
|
|
||||||
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$entries = $xpath->query('(//div[@class="post"])');
|
$entries = $xpath->query('(//div[@class="post"])');
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ class Af_Comics_Pvp extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//section[@class="comic-art"]')->item(0);
|
$basenode = $xpath->query('//section[@class="comic-art"]')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,9 @@ class Af_Comics_Tfd extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) {
|
$res = UrlHelper::fetch($article["link"]);
|
||||||
|
|
||||||
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0);
|
$basenode = $xpath->query('//img[contains(@src, ".gif")]')->item(0);
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,9 @@ class Af_Comics_Twp extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML(UrlHelper::fetch($article["link"]))) {
|
$res = UrlHelper::fetch($article["link"]);
|
||||||
|
|
||||||
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXpath($doc);
|
$xpath = new DOMXpath($doc);
|
||||||
|
|
||||||
$basenode = $xpath->query("//td/center/img")->item(0);
|
$basenode = $xpath->query("//td/center/img")->item(0);
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Af_Comics_Whomp extends Af_ComicFilter {
|
||||||
|
|
||||||
$doc = new DOMDocument();
|
$doc = new DOMDocument();
|
||||||
|
|
||||||
if (@$doc->loadHTML($res)) {
|
if ($res && $doc->loadHTML($res)) {
|
||||||
$xpath = new DOMXPath($doc);
|
$xpath = new DOMXPath($doc);
|
||||||
$basenode = $xpath->query('//img[@id="cc-comic"]')->item(0);
|
$basenode = $xpath->query('//img[@id="cc-comic"]')->item(0);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue