]> git.mjollnir.org Git - moodle.git/commitdiff
Mnet: Bugfix: Prevent a second record to be created for an existing host if the...
authordonal72 <donal72>
Mon, 15 Jan 2007 08:26:56 +0000 (08:26 +0000)
committerdonal72 <donal72>
Mon, 15 Jan 2007 08:26:56 +0000 (08:26 +0000)
mnet/peer.php

index 028040e463d5ec8ce160e8a6fde252579fce1930..898c12c6597f2fdb4fb6bfc9dc6c640da2b1cd3f 100644 (file)
@@ -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;