MDL-51170 core: Scheme section of URL should be case insensitive
authorAndrew Nicols <andrew@nicols.co.uk>
Fri, 21 Aug 2015 04:26:08 +0000 (12:26 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Fri, 21 Aug 2015 04:26:10 +0000 (12:26 +0800)
lib/weblib.php

index 60b65d3..f6a6a91 100644 (file)
@@ -2590,7 +2590,7 @@ function redirect($url, $message='', $delay=-1) {
     // Technically, HTTP/1.1 requires Location: header to contain the absolute path.
     // (In practice browsers accept relative paths - but still, might as well do it properly.)
     // This code turns relative into absolute.
-    if (!preg_match('|^[a-z]+:|', $url)) {
+    if (!preg_match('|^[a-z]+:|i', $url)) {
         // Get host name http://www.wherever.com.
         $hostpart = preg_replace('|^(.*?[^:/])/.*$|', '$1', $CFG->wwwroot);
         if (preg_match('|^/|', $url)) {