Merge branch 'MDL-52766-master-mnet-url-length' of git://github.com/mudrd8mz/moodle
authorDavid Monllao <davidm@moodle.com>
Wed, 10 Feb 2016 00:55:04 +0000 (08:55 +0800)
committerDavid Monllao <davidm@moodle.com>
Wed, 10 Feb 2016 00:55:04 +0000 (08:55 +0800)
mnet/peer.php

index 804b7d2..2776170 100644 (file)
@@ -170,7 +170,7 @@ class mnet_peer {
             $a['host'] = $this->wwwroot;
             $this->error[] = array('code' => 5, 'text' => get_string("nonmatchingcert", 'mnet', $a));
             return false;
-        } elseif ($credentials['subject']['CN'] != $this->wwwroot) {
+        } else if ($credentials['subject']['CN'] !== substr($this->wwwroot, 0, 64)) {
             $a['subject'] = $credentials['subject']['CN'];
             $a['host'] = $this->wwwroot;
             $this->error[] = array('code' => 4, 'text' => get_string("nonmatchingcert", 'mnet', $a));