]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Avatar.php
Yammer import API keys can now be overridden by the admin.
[quix0rs-gnu-social.git] / classes / Avatar.php
index 8d6424e8b2d1f53c5ccec912404ccde6ee7b26d9..dbe2cd813847eb585f94999b595e2f495ab0d03b 100644 (file)
@@ -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()