MDL-35669 gravatar Fix secure image urls.

This commit is contained in:
Eloy Lafuente (stronk7) 2012-10-02 01:19:33 +02:00
parent ee3502e793
commit b96a15cc11

View File

@ -400,6 +400,7 @@ class user_picture implements renderable {
// If the currently requested page is https then we'll return an
// https gravatar page.
if (strpos($CFG->httpswwwroot, 'https:') === 0) {
$gravatardefault = str_replace($CFG->wwwroot, $CFG->httpswwwroot, $gravatardefault); // Replace by secure url.
return new moodle_url("https://secure.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $gravatardefault));
} else {
return new moodle_url("http://www.gravatar.com/avatar/{$md5}", array('s' => $size, 'd' => $gravatardefault));