From cfbd464c72e750e59c04ffe06af534b13270e107 Mon Sep 17 00:00:00 2001 From: jmg324 Date: Thu, 20 Sep 2007 09:33:32 +0000 Subject: [PATCH] MDL-10296 made print_user_picture cater for https possibility in user/edit --- lib/weblib.php | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/weblib.php b/lib/weblib.php index 47927cd1963..6c67bfe4f4a 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -3338,11 +3338,17 @@ function print_user_picture($userid, $courseid, $picture, $size=0, $return=false $file = 'f2'; } $class = "userpicture"; + if (!empty($HTTPSPAGEREQUIRED)) { + $wwwroot = $CFG->httpswwwroot; + } else { + $wwwroot = $CFG->wwwroot; + } + if ($picture) { // Print custom user picture if ($CFG->slasharguments) { // Use this method if possible for better caching - $src = $CFG->wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg'; + $src = $wwwroot .'/user/pix.php/'. $userid .'/'. $file .'.jpg'; } else { - $src = $CFG->wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg'; + $src = $wwwroot .'/user/pix.php?file=/'. $userid .'/'. $file .'.jpg'; } } else { // Print default user pictures (use theme version if available) $class .= " defaultuserpic";