From: donal72 Date: Mon, 15 Jan 2007 08:26:56 +0000 (+0000) Subject: Mnet: Bugfix: Prevent a second record to be created for an existing host if the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e931feddaf7834b226736215d34209c6847d05a1;p=moodle.git Mnet: Bugfix: Prevent a second record to be created for an existing host if the user entered http://example.com/ as the wwwroot --- diff --git a/mnet/peer.php b/mnet/peer.php index 028040e463..898c12c659 100644 --- a/mnet/peer.php +++ b/mnet/peer.php @@ -27,6 +27,10 @@ class mnet_peer { function bootstrap($wwwroot) { + if (substr($wwwroot, 0, -1) == '/') { + $wwwroot = substr($wwwroot, 0, -1); + } + if ( ! $this->set_wwwroot($wwwroot) ) { $hostname = mnet_get_hostname_from_uri($wwwroot); @@ -52,10 +56,6 @@ class mnet_peer { } } - if (substr($wwwroot, 0, -1) == '/') { - $wwwroot = substr($wwwroot, 0, -1); - } - $this->wwwroot = $wwwroot; $this->ip_address = $ip_address; $this->deleted = 0;