]> git.mjollnir.org Git - moodle.git/commitdiff
Quick fix to the me() fix to the redirect function (for relative redirects).
authorsam_marshall <sam_marshall>
Mon, 25 Sep 2006 11:23:15 +0000 (11:23 +0000)
committersam_marshall <sam_marshall>
Mon, 25 Sep 2006 11:23:15 +0000 (11:23 +0000)
lib/weblib.php

index a39831fc7f754213ef990bcaa4784f349b4d18a6..6185a63bd5477b5e010d2526f97c6874016e1f7a 100644 (file)
@@ -4686,7 +4686,7 @@ function redirect($url, $message='', $delay=-1) {
                 $url = $hostpart.$url;
             } else {
                 // URLs not beginning with / are relative to path of current script, so add that on.
-                $url = $hostpart.me().'/../'.$url;
+                $url = $hostpart.preg_replace('|\?.*$|','',me()).'/../'.$url;
             }
             // Replace all ..s
             while (true) {