From 21ce7d9ec02b0bf7c6e0ac7c28bc7c1bb0a841c5 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 26 Apr 2017 20:57:36 +0300 Subject: update phpmd ruleset to use (subset) of cleancode fix various minor issues reported by static analysis remove redundant php closing tag from several more files --- plugins/af_comics/filters/af_comics_dilbert.php | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) (limited to 'plugins/af_comics/filters/af_comics_dilbert.php') diff --git a/plugins/af_comics/filters/af_comics_dilbert.php b/plugins/af_comics/filters/af_comics_dilbert.php index 5faba7eb7..9eed7232a 100644 --- a/plugins/af_comics/filters/af_comics_dilbert.php +++ b/plugins/af_comics/filters/af_comics_dilbert.php @@ -19,30 +19,11 @@ class Af_Comics_Dilbert extends Af_ComicFilter { $doc = new DOMDocument(); @$doc->loadHTML($res); - $basenode = false; - if ($doc) { $xpath = new DOMXPath($doc); $basenode = $xpath->query('//img[contains(@class, "img-comic")]')->item(0); - /* $entries = $xpath->query('(//img[@src])'); // we might also check for img[@class='strip'] I guess... - - $matches = array(); - - foreach ($entries as $entry) { - - if (preg_match("/dyn\/str_strip\/.*strip\.gif$/", $entry->getAttribute("src"), $matches)) { - - $entry->setAttribute("src", - rewrite_relative_url("http://dilbert.com/", - $matches[0])); - - $basenode = $entry; - break; - } - } */ - if ($basenode) { $article["content"] = $doc->saveXML($basenode); } @@ -53,5 +34,4 @@ class Af_Comics_Dilbert extends Af_ComicFilter { return false; } -} -?> +} \ No newline at end of file -- cgit v1.2.3