X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=classes%2FAvatar.php;h=dbe2cd813847eb585f94999b595e2f495ab0d03b;hb=def37ee796fb4f29cc62598e933477b2c239cf1e;hp=5e8b315fe6b419998b3617710d8f01baa8584651;hpb=44343986c31b20158ef07438f85a6bf35b93a3ab;p=quix0rs-gnu-social.git diff --git a/classes/Avatar.php b/classes/Avatar.php index 5e8b315fe6..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() @@ -102,6 +113,6 @@ class Avatar extends Memcached_DataObject static $sizenames = array(AVATAR_PROFILE_SIZE => 'profile', AVATAR_STREAM_SIZE => 'stream', AVATAR_MINI_SIZE => 'mini'); - return theme_path('default-avatar-'.$sizenames[$size].'.png'); + return Theme::path('default-avatar-'.$sizenames[$size].'.png'); } }