diff options
author | Bharat Mediratta <bharat@menalto.com> | 2011-04-21 15:50:53 -0700 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2011-04-21 15:50:53 -0700 |
commit | 08a6df2274ea196056eb7441d4aff050dc3531fa (patch) | |
tree | 93da2ec5527009a11867d286588759ff3c2733b4 | |
parent | 8cf066b838a98ace3cfa81e02ccc7a8570d1ba7f (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.
-rw-r--r-- | modules/gallery/helpers/theme.php | 7 |
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) { |