Skip to content

Commit

Permalink
MDL-59539 oauth2/issuer: Changed baseurl for guessing image URL
Browse files Browse the repository at this point in the history
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'.
  • Loading branch information
tobiasreischmann committed Jul 14, 2017
1 parent 350700b commit d029841
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/classes/oauth2/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit d029841

Please sign in to comment.