From: paulr Date: Tue, 2 Aug 2011 10:09:58 +0000 (+1000) Subject: fixed a prob with the url matching code X-Git-Url: http://git.pjr.cc/?a=commitdiff_plain;h=a55b4f6b15d491e70226156a2aadb88b16853dc0;p=glcas.git fixed a prob with the url matching code --- 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 @@