X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FAvatar.php;h=6edc81768551e00780ae2cb3b2803bb94ab0bd82;hb=90037696093742abdc4e92171eb5188e8ad64ec0;hp=cc7a6b64717ac5534c9aeeb9a473ad26dcf0f222;hpb=4b98edf75f4e255f8c61087bd1525d89653a521f;p=quix0rs-gnu-social.git diff --git a/classes/Avatar.php b/classes/Avatar.php index cc7a6b6471..6edc817685 100644 --- a/classes/Avatar.php +++ b/classes/Avatar.php @@ -37,13 +37,14 @@ class Avatar extends Memcached_DataObject } } - function &pkeyGet($kv) + function pkeyGet($kv) { return Memcached_DataObject::pkeyGet('Avatar', $kv); } - // where should the avatar go for this user? - + /** + * Where should the avatar go for this user? + */ static function filename($id, $extension, $size=null, $extra=null) { if ($size) { @@ -81,10 +82,21 @@ class Avatar extends Memcached_DataObject if (empty($server)) { $server = common_config('site', 'server'); } - common_debug('path = ' . $path); - // XXX: protocol - return 'http://'.$server.$path.$filename; + $ssl = common_config('avatar', 'ssl'); + + if (is_null($ssl)) { // null -> guess + if (common_config('site', 'ssl') == 'always' && + !common_config('avatar', 'server')) { + $ssl = true; + } else { + $ssl = false; + } + } + + $protocol = ($ssl) ? 'https' : 'http'; + + return $protocol.'://'.$server.$path.$filename; } function displayUrl()