3
1
Back

Standardized appending alt/title text under images (extra useful for non-browser users $entries = $xpath->query("//div[@class='entry']"); foreach ($entries as $entry){ $article['content'] .= "
Alt: " . $article['id']; } return $article; } function get_img_tags($xpath, $query, $article){ /* dirty absolute URL */ /* 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 mangle_article($article) { if (GDORN_DEBUG && $article['debug']) { foreach ($article['debugging'] as $msg) { $article['content'] = $this->get_img_tags($xpath, '(//div[@class="webcomic-image"]//img)', $article); } function api_version() { return $this->mangle_article($article); } function rel2abs($rel, $base if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $this->mangle_article($article); } function rel2abs($rel, $base $path = preg_replace('#/[^/]*$#', '', $path); /* replace '//' or.

New Pull Request