From a55b4f6b15d491e70226156a2aadb88b16853dc0 Mon Sep 17 00:00:00 2001 From: paulr Date: Tue, 2 Aug 2011 20:09:58 +1000 Subject: [PATCH] fixed a prob with the url matching code --- libglcas/urlparser.php | 9 +++++++-- libglcas/web.php | 2 +- plugins/cron.php | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libglcas/urlparser.php b/libglcas/urlparser.php index 89c9bb1..ab7e69c 100644 --- a/libglcas/urlparser.php +++ b/libglcas/urlparser.php @@ -23,10 +23,9 @@ class GLCASUrlParser { if(is_array($this->urlClasses)) { foreach($this->urlClasses as $key => $val) { error_log("checking url $url against $key, $val"); - if($url == "/") { + if($key == "/") { $base = $val; error_log("base set to $val"); - return new $val($this->config); } // TODO: this is quite messy really, need to think about how i do /'s in urls for url parsers @@ -41,6 +40,12 @@ class GLCASUrlParser { } } } + + // check for "bases" + if($url == "/") { + return new $base($this->config); + } + } error_log("get class returns default"); return new $default($this->config); diff --git a/libglcas/web.php b/libglcas/web.php index 7ef4de6..0d812d9 100644 --- a/libglcas/web.php +++ b/libglcas/web.php @@ -75,7 +75,7 @@ function GLCASpageBuilder($bodyClass, $bodyFunction, $bodycontent=null, $title=" $mt = preg_match("/.*.js$/", $file); if($mt > 0) { error_log("loading js $file"); - echo ""; + echo ""; //echo "required $basedir/$file\n"; } } diff --git a/plugins/cron.php b/plugins/cron.php index 8168e9a..ca99309 100644 --- a/plugins/cron.php +++ b/plugins/cron.php @@ -1,6 +1,6 @@