From: dwoolhead Date: Mon, 27 Nov 2006 16:42:16 +0000 (+0000) Subject: MDL-7699 Fixed redirect() to ../../ X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=23ff199c26d9d98ad9d420be1f616130c3fb2599;p=moodle.git MDL-7699 Fixed redirect() to ../../ --- diff --git a/lib/weblib.php b/lib/weblib.php index c74f4c4f1f..58803bd257 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -4721,7 +4721,7 @@ function redirect($url, $message='', $delay=-1) { } // Replace all ..s while (true) { - $newurl = preg_replace('|/[^/]*/\.\./|', '/', $url); + $newurl = preg_replace('|/(?!\.\.)[^/]*/\.\./|', '/', $url); if ($newurl == $url) { break; }