mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
Mnet: Bugfix: Prevent a second record to be created for an existing host if the user entered http://example.com/ as the wwwroot
This commit is contained in:
parent
ca1131e2ea
commit
e931feddaf
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user