3
1
Back

/* replace '//' or '/./' or '/foo/../' with '/' */ $re = array('#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#'); for($n=1; $n>0; $abs=preg_replace($re, '/', $abs, -1, $n)) {} /* absolute URL is ready! */ Assorted updates elseif (strpos($article['link'], 'www.timothywinchester.com/2') !== FALSE) { $article['content'] .= "
ID: " . $article['id']; } function rel2abs($rel, $base) { if (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { if ($rel[0] == '#' || $rel[0] == '?') { return $base.$rel; } extract(parse_url($base)); $path = preg_replace('#/[^/]*$#', '', $path); if ($rel[0] == '#' || $rel[0] == '?') { return $this->mangle_article($article); } function mangle_article($article) { if (!$title_text || $title_text == $article['title'] || strpos($article['title'], $alt_text) !== False) { if (strpos($article['link'], 'eatthattoast.com/comic/') !== FALSE) { // Joy of Tech // Joy of Tech elseif (strpos($article['link'], 'jesusandmo.net') !== FALSE.

New Pull Request