X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FDesign.php;h=ff44e010964042f0d6e8b18de603668c2c71d496;hb=fa4a2d34855da5eca29d81409cb5fbd64f13faba;hp=b53096aa289fe0c2367188dcea0aa88abdff8da9;hpb=36e5d2b45f9ec240c0cecbb78afcce92e2962a49;p=quix0rs-gnu-social.git diff --git a/classes/Design.php b/classes/Design.php index b53096aa28..ff44e01096 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -1,7 +1,7 @@ . */ -if (!defined('LACONICA')) { +if (!defined('STATUSNET') && !defined('LACONICA')) { exit(1); } @@ -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); } } @@ -115,7 +115,7 @@ class Design extends Memcached_DataObject return new WebColor($color); } catch (WebColorException $e) { // This shouldn't happen - common_log(LOG_ERR, "Unable to create color for design $this->id.", + common_log(LOG_ERR, "Unable to create web color for $color", __FILE__); return null; } @@ -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) @@ -204,7 +215,10 @@ class Design extends Memcached_DataObject 'disposition'); foreach ($attrs as $attr) { - $siteDesign->$attr = common_config('design', $attr); + $val = common_config('design', $attr); + if ($val !== false) { + $siteDesign->$attr = $val; + } } }