]> git.mjollnir.org Git - moodle.git/commitdiff
weblib MDL-20276 Reverted fix to deal with relative URLs
authorsamhemelryk <samhemelryk>
Wed, 16 Sep 2009 09:17:25 +0000 (09:17 +0000)
committersamhemelryk <samhemelryk>
Wed, 16 Sep 2009 09:17:25 +0000 (09:17 +0000)
lib/weblib.php

index 2d0d0d13739a61936a740153727dcf8bc09d92da..1816743b0859773ad8d2ae9d1a614b9e2d73468c 100644 (file)
@@ -565,6 +565,11 @@ function prepare_url($url, $stripformparams=false) {
         }
     }
 
+    // Add wwwroot only if the URL does not already start with http:// or https://
+    if (!preg_match('|https?://|', $output) ) {
+        $output = $CFG->wwwroot . $output;
+    }
+
     return $output;
 }