3
1
Back

$xpath->query($query); $result_html = ''; } /* absolute URL is ready! */ } /* 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 is ready! */ return $scheme.'://'.$abs; } function get_xpath_dealie($link){ list($html, $content_type) = $this->get_content($link); $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // SBMC elseif (strpos($article["link"], "explosm.net/comics") !== FALSE) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach ($imgs as $img) { if (strpos($article["content"], "bonus panel!") !== FALSE) { $imgs = $xpath->query('//img'); //doesn't get simpler than this foreach($imgs as $img){ foreach ($imgs as $img) { if ($title_text == $article['title'] || strpos($article['title'], $alt_text) !== false){ // there's both alt and title texts, they're both different, use both. $alt_element = $doc->createElement("i.

New Pull Request