3
1
Back

"

"; } } } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users if (preg_match("@.*(get_img_tags($xpath, '//td/img[contains(@src, "/comics/images/")]', $article); } // Least I Could Do (wtf image size? Elseif (strpos($article['link'], 'leasticoulddo.com/comic') !== FALSE) { // Awkward Zombie elseif (strpos($article['link'], 'http://www.geekculture.com/joyoftech/') !== FALSE) { $xpath = new DOMXPath($doc); } function hook_render_article($article) { try { return $this->mangle_article($article); } catch (Exception $e) { $article['content'] .= "
Alt: $alt_text
"; } } /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) { } function get_img_tags($xpath, $query, $article){ $entries = $xpath->query("//div[@class='entry']"); foreach ($entries as $entry){ $article['content.

New Pull Request