summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-02-11 16:51:15 -0500
committerEvan Prodromou <evan@status.net>2010-02-11 16:51:15 -0500
commitd6869cde7ba7e577d54f0c6ecab3599dc85f0f67 (patch)
treeccfada34a590d03be453a4ff89487cf1ebc19a73 /classes
parent5175b5062ea7635016a392496e8495d03d71a4ae (diff)
let avatars be served over SSL
Diffstat (limited to 'classes')
-rw-r--r--classes/Avatar.php15
1 files changed, 13 insertions, 2 deletions
diff --git a/classes/Avatar.php b/classes/Avatar.php
index 91bde0f04..dbe2cd813 100644
--- a/classes/Avatar.php
+++ b/classes/Avatar.php
@@ -82,9 +82,20 @@ class Avatar extends Memcached_DataObject
$server = common_config('site', 'server');
}
- // XXX: protocol
+ $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 'http://'.$server.$path.$filename;
+ return $protocol.'://'.$server.$path.$filename;
}
function displayUrl()