3
1
Back

$matches[1]; $article['content'] = $doc->saveHTML(); function get_img_tags($xpath, $query, $article){ /* dirty absolute URL */ $abs = "$host$path/$rel"; /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL */ $abs = "$host$path/$rel"; /* replace '//' or '/./' or '/foo/../' with '/' */ } /* dirty absolute URL is ready! */ return $scheme . '://' . $abs; if (preg_match("@.*(get_img_tags($xpath, "//div[@class='img-comic-container']//img", $article); // Manic Pixie Nightmare Girls elseif (strpos($article["link"], "poorlydrawnlines.com/comic/") !== FALSE && strpos($article["title"], "Comic:") !== FALSE) { $doc = new DOMXpath($doc); $imgs = $xpath->query('//img'); $alt_text = trim($entry->getAttribute('title')); $result_html .= "
Alt: " . $article['id']; } return $article; } /* dirty absolute URL.

New Pull Request