From 97a7fb246c8de9a2cf1bfc38ca275a13e9c40f58 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 14 Oct 2010 01:35:11 -0400 Subject: [PATCH] correctly use sslserver if it is set --- classes/Design.php | 7 ++++++- lib/htmloutputter.php | 7 ++++++- lib/theme.php | 7 ++++++- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/classes/Design.php b/classes/Design.php index 50712ce8b5..a8fdb72191 100644 --- a/classes/Design.php +++ b/classes/Design.php @@ -146,7 +146,12 @@ class Design extends Memcached_DataObject if (empty($sslserver)) { // XXX: this assumes that background dir == site dir + /background/ // not true if there's another server - $server = common_config('site', 'server'); + if (is_string(common_config('site', 'sslserver')) && + mb_strlen(common_config('site', 'sslserver')) > 0) { + $server = common_config('site', 'sslserver'); + } else if (common_config('site', 'server')) { + $server = common_config('site', 'server'); + } $path = common_config('site', 'path') . '/background/'; } else { $server = $sslserver; diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php index f01f1814f0..4a1b7db472 100644 --- a/lib/htmloutputter.php +++ b/lib/htmloutputter.php @@ -371,7 +371,12 @@ class HTMLOutputter extends XMLOutputter $sslserver = common_config('javascript', 'sslserver'); if (empty($sslserver)) { - $server = common_config('site', 'server'); + if (is_string(common_config('site', 'sslserver')) && + mb_strlen(common_config('site', 'sslserver')) > 0) { + $server = common_config('site', 'sslserver'); + } else if (common_config('site', 'server')) { + $server = common_config('site', 'server'); + } $path = common_config('site', 'path') . '/js/'; } else { $server = $sslserver; diff --git a/lib/theme.php b/lib/theme.php index 669d9a19fd..95b7c1de4b 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -121,7 +121,12 @@ class Theme $sslserver = common_config($group, 'sslserver'); if (empty($sslserver)) { - $server = common_config('site', 'server'); + if (is_string(common_config('site', 'sslserver')) && + mb_strlen(common_config('site', 'sslserver')) > 0) { + $server = common_config('site', 'sslserver'); + } else if (common_config('site', 'server')) { + $server = common_config('site', 'server'); + } $path = common_config('site', 'path') . '/'; if ($fallbackSubdir) { $path .= $fallbackSubdir . '/'; -- 2.39.5