X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FAvatar.php;h=dbe2cd813847eb585f94999b595e2f495ab0d03b;hb=5c05cd2b1a93d360bde7cb7dfc9ba39e5a5a7624;hp=cc7a6b64717ac5534c9aeeb9a473ad26dcf0f222;hpb=8e58f241739b97bd53f78035781f16e2067a31d9;p=quix0rs-gnu-social.git diff --git a/classes/Avatar.php b/classes/Avatar.php index cc7a6b6471..dbe2cd8138 100644 --- a/classes/Avatar.php +++ b/classes/Avatar.php @@ -37,7 +37,7 @@ class Avatar extends Memcached_DataObject } } - function &pkeyGet($kv) + function pkeyGet($kv) { return Memcached_DataObject::pkeyGet('Avatar', $kv); } @@ -81,10 +81,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()