MDL-35669 gravatar Fix secure image urls.
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 1 Oct 2012 23:19:33 +0000 (01:19 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Mon, 1 Oct 2012 23:35:40 +0000 (01:35 +0200)
lib/outputcomponents.php

index c29ccc2..5e1cf96 100644 (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));