3
1
Back

If (parse_url($rel, PHP_URL_SCHEME) != '' || substr($rel, 0, 2) == '//') { return $base . $rel; } if ($rel[0] == '/') { $path = ''; } /* dirty absolute URL */ /* replace '//' or '/./' or '/foo/../' with '/' */ $re = array( '#(/\.?/)#', '#/(?!\.\.)[^/]+/\.\./#' ); for ($n = 1; $n > 0; $abs = "$host$path/$rel"; /* replace '//' or '/./' or '/foo/../' with '/' */ for($n=1; $n>0; $abs=preg_replace($re, '/', $abs.

New Pull Request