3
1
Back

Else if (bottom_element=="switch") { } function get_xpath_dealie($link) { $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 = preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL */ $abs = preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL is ready! */ return $scheme . '://' . $abs; if (preg_match("@.*(alt_textify($article); if (GDORN_DEBUG && $article['debug']) { foreach ($imgs as $img) { $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic']//img", $article); } // Dead Philosophers elseif (strpos($article['link'], 'twolumps.net/d/') !== FALSE) { $xpath = $this->get_xpath_dealie($article['link']); $article['content'] = $this->get_img_tags($xpath, "//p[@id='comic_body']//a//img", $article); elseif (strpos($article['content'], 'imgs.xkcd.com/comics/') !== FALSE) { //No matches if ($img->getAttribute('title')) { $article['content'] .= "
Alt: " . $img->getAttribute('title.

New Pull Request