MDL-25299 mnet: Fixed validation when no public key is provided

This commit is contained in:
Sam Hemelryk 2012-02-17 16:47:15 +13:00
parent 0dde394db5
commit 4460312d08
3 changed files with 6 additions and 2 deletions

View file

@ -155,7 +155,7 @@ class mnet_peer {
function check_credentials($key) {
$credentials = openssl_x509_parse($key);
if ($credentials == false) {
$this->error[] = array('code' => 3, 'text' => get_string("nonmatchingcert", 'mnet', array('','')));
$this->error[] = array('code' => 3, 'text' => get_string("nonmatchingcert", 'mnet', array('subject' => '','host' => '')));
return false;
} elseif (array_key_exists('subjectAltName', $credentials['subject']) && $credentials['subject']['subjectAltName'] != $this->wwwroot) {
$a['subject'] = $credentials['subject']['subjectAltName'];