summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/theme.php
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2011-04-21 15:50:53 -0700
committerBharat Mediratta <bharat@menalto.com>2011-04-21 15:50:53 -0700
commit08a6df2274ea196056eb7441d4aff050dc3531fa (patch)
tree93da2ec5527009a11867d286588759ff3c2733b4 /modules/gallery/helpers/theme.php
parent8cf066b838a98ace3cfa81e02ccc7a8570d1ba7f (diff)
Normally Router::find_uri() strips off the url suffix for us, but when
we make the theme::$is_admin determination we're working off of the PATH_INFO so we need to strip it off manually. Fixes #1631.
Diffstat (limited to 'modules/gallery/helpers/theme.php')
-rw-r--r--modules/gallery/helpers/theme.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/gallery/helpers/theme.php b/modules/gallery/helpers/theme.php
index f285834c..a42fa7ad 100644
--- a/modules/gallery/helpers/theme.php
+++ b/modules/gallery/helpers/theme.php
@@ -41,6 +41,13 @@ class theme_Core {
$config = Kohana_Config::instance();
$modules = $config->get("core.modules");
+
+ // Normally Router::find_uri() strips off the url suffix for us, but we're working off of the
+ // PATH_INFO here so we need to strip it off manually
+ if ($suffix = Kohana::config("core.url_suffix")) {
+ $path = preg_replace("#" . preg_quote($suffix) . "$#u", "", $path);
+ }
+
self::$is_admin = $path == "/admin" || !strncmp($path, "/admin/", 7);
self::$site_theme_name = module::get_var("gallery", "active_site_theme");
if (self::$is_admin) {