summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-10-14 00:59:53 -0400
committerEvan Prodromou <evan@status.net>2010-10-14 00:59:53 -0400
commit74c5aa8f9a37b76f6bee571dd9fccf6ac4fc9e90 (patch)
tree888c34fd090a0bff3516a2d76a0fe1784d929ea4
parentca0323d01b9c38fe864c8f902d770061e893708b (diff)
consolidate some theme path code between ssl and non-ssl
-rw-r--r--lib/theme.php30
1 files changed, 12 insertions, 18 deletions
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;
}
/**