]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - classes/Design.php
Move hasFave() to Profile
[quix0rs-gnu-social.git] / classes / Design.php
index 89ae50c8cb9d72b9a17be6f43d1731890c328503..ff44e010964042f0d6e8b18de603668c2c71d496 100644 (file)
@@ -101,7 +101,7 @@ class Design extends Memcached_DataObject
         }
 
         if (0 != mb_strlen($css)) {
-            $out->element('style', array('type' => 'text/css'), $css);
+            $out->style($css);
         }
     }
 
@@ -155,9 +155,20 @@ class Design extends Memcached_DataObject
             $server = common_config('site', 'server');
         }
 
-        // XXX: protocol
+        $ssl = common_config('background', 'ssl');
 
-        return 'http://'.$server.$path.$filename;
+        if (is_null($ssl)) { // null -> guess
+            if (common_config('site', 'ssl') == 'always' &&
+                !common_config('background', 'server')) {
+                $ssl = true;
+            } else {
+                $ssl = false;
+            }
+        }
+
+        $protocol = ($ssl) ? 'https' : 'http';
+
+        return $protocol.'://'.$server.$path.$filename;
     }
 
     function setDisposition($on, $off, $tile)