X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FAvatar.php;h=dbe2cd813847eb585f94999b595e2f495ab0d03b;hb=ef7e85c0ab79dcac5239aaee2e3f329588db6397;hp=8d6424e8b2d1f53c5ccec912404ccde6ee7b26d9;hpb=42da45d3bc3cd0caa34f8d9f34c5617fedbb755e;p=quix0rs-gnu-social.git diff --git a/classes/Avatar.php b/classes/Avatar.php index 8d6424e8b2..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); } @@ -82,9 +82,20 @@ class Avatar extends Memcached_DataObject $server = common_config('site', 'server'); } - // XXX: protocol + $ssl = common_config('avatar', 'ssl'); - return 'http://'.$server.$path.$filename; + 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()