From 23ff199c26d9d98ad9d420be1f616130c3fb2599 Mon Sep 17 00:00:00 2001 From: dwoolhead Date: Mon, 27 Nov 2006 16:42:16 +0000 Subject: [PATCH] MDL-7699 Fixed redirect() to ../../ --- lib/weblib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } -- 2.39.5