Browse Source

af_comics filters: don't try to load empty html

master
Andrew Dolgov 1 year ago
parent
commit
c8883d3440
  1. 2
      plugins/af_comics/filters/af_comics_cad.php
  2. 2
      plugins/af_comics/filters/af_comics_comicclass.php
  3. 2
      plugins/af_comics/filters/af_comics_comicpress.php
  4. 2
      plugins/af_comics/filters/af_comics_darklegacy.php
  5. 2
      plugins/af_comics/filters/af_comics_dilbert.php
  6. 4
      plugins/af_comics/filters/af_comics_pa.php
  7. 2
      plugins/af_comics/filters/af_comics_pvp.php
  8. 4
      plugins/af_comics/filters/af_comics_tfd.php
  9. 4
      plugins/af_comics/filters/af_comics_twp.php
  10. 2
      plugins/af_comics/filters/af_comics_whomp.php

2
plugins/af_comics/filters/af_comics_cad.php

@ -17,7 +17,7 @@ class Af_Comics_Cad extends Af_ComicFilter {
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);

2
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);

2
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);

2
plugins/af_comics/filters/af_comics_darklegacy.php

@ -18,7 +18,7 @@ class Af_Comics_DarkLegacy 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);

2
plugins/af_comics/filters/af_comics_dilbert.php

@ -19,7 +19,7 @@ class Af_Comics_Dilbert extends Af_ComicFilter {
$doc = new DOMDocument();
if (@$doc->loadHTML($res)) {
if ($res && $doc->loadHTML($res)) {
$xpath = new DOMXPath($doc);
// Get the image container

4
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"])');

2
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);

4
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);

4
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);

2
plugins/af_comics/filters/af_comics_whomp.php

@ -17,7 +17,7 @@ class Af_Comics_Whomp extends Af_ComicFilter {
$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);

Loading…
Cancel
Save