From: donal Date: Wed, 13 Feb 2008 03:06:52 +0000 (+0000) Subject: Ensure that the wwwroot has been supplied with a http:// or https:// prefix X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=6102b5ff38c64c7235fd4da1f991b49171f13de6;p=moodle.git Ensure that the wwwroot has been supplied with a http:// or https:// prefix --- diff --git a/admin/mnet/peers.php b/admin/mnet/peers.php index dcb35ee6f7..09ae5d314a 100644 --- a/admin/mnet/peers.php +++ b/admin/mnet/peers.php @@ -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')) {