From 12ef4272aec65db672eb6c8c054e65bdfda29e61 Mon Sep 17 00:00:00 2001 From: Bharat Mediratta Date: Thu, 4 Jun 2009 18:40:38 -0700 Subject: Work around a problem with the CGI sapi on urls that don't contain index.php (ie, /gallery3 instead of /gallery3/index.php) that causes is to mis-route. --- modules/gallery/helpers/MY_url.php | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'modules') diff --git a/modules/gallery/helpers/MY_url.php b/modules/gallery/helpers/MY_url.php index 38f0a683..c8645c4d 100644 --- a/modules/gallery/helpers/MY_url.php +++ b/modules/gallery/helpers/MY_url.php @@ -38,6 +38,14 @@ class url extends url_Core { return; } + // Work around problems with the CGI sapi by enforcing our default path + if ($_SERVER["SCRIPT_NAME"] && "/" . Router::$current_uri == $_SERVER["SCRIPT_NAME"]) { + Router::$controller_path = MODPATH . "gallery/controllers/albums.php"; + Router::$controller = "albums"; + Router::$method = 1; + return; + } + $current_uri = html_entity_decode(Router::$current_uri, ENT_QUOTES); $item = ORM::factory("item")->where("relative_path_cache", $current_uri)->find(); if (!$item->loaded) { -- cgit v1.2.3