From 4d9eb54b138d449eb52bfda3ea948452200bd97d Mon Sep 17 00:00:00 2001 From: Josh Sherman Date: Thu, 12 Sep 2013 17:59:29 -0400 Subject: [PATCH] Dropped dot syntax Too much juggling to make sure the proper assets were loaded. Opened up a security issue that allowed some pages to be accessed even if data was missing, just a headache, best to move away from it and allow users to defining custom routing in inde.php. Perhaps down the road allowing a Route class that the user can define everything in. --- classes/Controller.php | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/classes/Controller.php b/classes/Controller.php index 8ce6238..28d78d9 100644 --- a/classes/Controller.php +++ b/classes/Controller.php @@ -98,7 +98,7 @@ class Controller extends Object } // Loads the module's information - list($module_class, $module_filename, $template_basename, $css_class, $js_basename, $dot_syntax) = $this->prepareVariables($request); + list($module_class, $module_filename, $template_basename, $css_class, $js_basename) = $this->prepareVariables($request); unset($request); @@ -116,11 +116,7 @@ class Controller extends Object } else { - if ($dot_syntax) - { - Browser::goHome(); - } - elseif ($this->config->pickles['logging'] === true) + if ($this->config->pickles['logging'] === true) { Log::warning('Class named ' . $module_class . ' was not found in ' . $module_filename); } @@ -476,14 +472,6 @@ class Controller extends Object */ public function prepareVariables($basename) { - $dot_syntax = strpos($basename, '.') !== false; - - if ($dot_syntax) - { - list($basename, $action) = explode('.', $basename, 2); - $action = str_replace('.', '_', $action); - } - // Sets up all of our variables $module_class = strtr($basename, '/', '_'); $module_filename = SITE_MODULE_PATH . $basename . '.php'; @@ -505,7 +493,7 @@ class Controller extends Object $module_class = preg_replace('/(-(.{1}))/e', 'strtoupper("$2")', $module_class); } - return array($module_class, $module_filename, $template_basename, $css_class, $js_basename, $dot_syntax); + return array($module_class, $module_filename, $template_basename, $css_class, $js_basename); } }