]> git.mjollnir.org Git - moodle.git/commitdiff
Ensure that the wwwroot has been supplied with a http:// or https:// prefix
authordonal <donal>
Wed, 13 Feb 2008 03:06:52 +0000 (03:06 +0000)
committerdonal <donal>
Wed, 13 Feb 2008 03:06:52 +0000 (03:06 +0000)
admin/mnet/peers.php

index dcb35ee6f716bcafa4fb9115b8a49b74417240dd..09ae5d314aa22b208aec115e7fa634a66569aa6f 100644 (file)
@@ -50,6 +50,11 @@ if (($form = data_submitted()) && confirm_sesskey()) {
     if (!empty($form->wwwroot)) {
         // ensure we remove trailing slashes
         $form->wwwroot = preg_replace(':/$:', '', $form->wwwroot);
+
+        // ensure the wwwroot starts with a http or https prefix
+        if (strtolower(substr($form->wwwroot, 0, 4)) != 'http') {
+            $form->wwwroot = 'http://'.$form->wwwroot;
+        }
     }
 
     if(!function_exists('xmlrpc_encode_request')) {