summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-06-04 18:40:38 -0700
committerBharat Mediratta <bharat@menalto.com>2009-06-04 18:40:38 -0700
commit12ef4272aec65db672eb6c8c054e65bdfda29e61 (patch)
tree0f3f9b33cd3d4f12a030e604d876571a4bbbb112 /modules
parente5a010476992dd6b5ad949673486571c39536d32 (diff)
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.
Diffstat (limited to 'modules')
-rw-r--r--modules/gallery/helpers/MY_url.php8
1 files changed, 8 insertions, 0 deletions
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) {