From 4699f2adf56d4642980bcfd8f42cb0541e8c1bae Mon Sep 17 00:00:00 2001 From: Tobias Reischmann Date: Fri, 14 Jul 2017 11:10:50 +0200 Subject: [PATCH] MDL-59539 oauth2/issuer: Changed baseurl for guessing image URL The url, which was used for guessing the image, was queried with the key 'discoveryurl', which is not defined in the context of an issuer. The baseurl should be sufficient to retrieve the favicon.ico from a server. That's why the key for was changed from 'discoveryurl' to 'baseurl'. --- lib/classes/oauth2/api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/classes/oauth2/api.php b/lib/classes/oauth2/api.php index d7c0cad7d42b6..966ea3ffa0676 100644 --- a/lib/classes/oauth2/api.php +++ b/lib/classes/oauth2/api.php @@ -349,7 +349,7 @@ public static function get_user_field_mappings(issuer $issuer) { */ protected static function guess_image($issuer) { if (empty($issuer->get('image'))) { - $baseurl = parse_url($issuer->get('discoveryurl')); + $baseurl = parse_url($issuer->get('baseurl')); $imageurl = $baseurl['scheme'] . '://' . $baseurl['host'] . '/favicon.ico'; $issuer->set('image', $imageurl); $issuer->update();