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.
This commit is contained in:
Bharat Mediratta
2011-04-21 15:50:53 -07:00
parent 8cf066b838
commit 08a6df2274

View File

@@ -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) {