From: Evan Prodromou Date: Thu, 14 Oct 2010 04:59:53 +0000 (-0400) Subject: consolidate some theme path code between ssl and non-ssl X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=74c5aa8f9a37b76f6bee571dd9fccf6ac4fc9e90;p=quix0rs-gnu-social.git consolidate some theme path code between ssl and non-ssl --- diff --git a/lib/theme.php b/lib/theme.php index 500e168fb1..669d9a19fd 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; } /**