3
1
Back

$xpath->query('//img'); $alt_text = trim($img->getAttribute('title')); if (!$alt_text) { $new_element = $doc->createElement("img"); $article['content'] = $this->get_img_tags($xpath, "//div[@id='comic-img']//img", $article); } Clean up code formatting; added a few comics; standardized appending alt/title text under images (extra useful for non-browser users /* 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.

New Pull Request