From 74c5aa8f9a37b76f6bee571dd9fccf6ac4fc9e90 Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Thu, 14 Oct 2010 00:59:53 -0400 Subject: consolidate some theme path code between ssl and non-ssl --- lib/theme.php | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) (limited to 'lib/theme.php') diff --git a/lib/theme.php b/lib/theme.php index 500e168fb..669d9a19f 100644 --- a/lib/theme.php +++ b/lib/theme.php @@ -134,15 +134,7 @@ class Theme } } - if ($path[strlen($path)-1] != '/') { - $path .= '/'; - } - - if ($path[0] != '/') { - $path = '/'.$path; - } - - return 'https://'.$server.$path.$name; + $protocol = 'https'; } else { @@ -155,22 +147,24 @@ class Theme } } - if ($path[strlen($path)-1] != '/') { - $path .= '/'; - } - - if ($path[0] != '/') { - $path = '/'.$path; - } - $server = common_config($group, 'server'); if (empty($server)) { $server = common_config('site', 'server'); } - return 'http://'.$server.$path.$name; + $protocol = 'http'; + } + + if ($path[strlen($path)-1] != '/') { + $path .= '/'; } + + if ($path[0] != '/') { + $path = '/'.$path; + } + + return $protocol.'://'.$server.$path.$name; } /** -- cgit v1.2.3-54-g00ecf