]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-7699 Fixed redirect() to ../../
authordwoolhead <dwoolhead>
Mon, 27 Nov 2006 16:42:16 +0000 (16:42 +0000)
committerdwoolhead <dwoolhead>
Mon, 27 Nov 2006 16:42:16 +0000 (16:42 +0000)
lib/weblib.php

index c74f4c4f1ff480a638a35b8646091cad7a84a1c4..58803bd257b1d7ca438be7794faf5111c88ccd2f 100644 (file)
@@ -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;
                 }