summaryrefslogtreecommitdiff
path: root/app/Core/Router.php
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2015-10-12 14:44:28 -0400
committerFrederic Guillot <fred@kanboard.net>2015-10-12 14:44:28 -0400
commite515f37435db6cf883215f13f02391d8b2107d47 (patch)
tree3df01bc0c420a2c497302c5a38aa9d724b2e764c /app/Core/Router.php
parente57386a18393e85f073cccff70699ad9afc19119 (diff)
Add user CSV import
Diffstat (limited to 'app/Core/Router.php')
-rw-r--r--app/Core/Router.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Core/Router.php b/app/Core/Router.php
index 93d266bb..55ebe4a8 100644
--- a/app/Core/Router.php
+++ b/app/Core/Router.php
@@ -197,7 +197,7 @@ class Router extends Base
*/
public function sanitize($value, $default_value)
{
- return ! ctype_alpha($value) || empty($value) ? $default_value : strtolower($value);
+ return ! preg_match('/^[a-zA-Z_0-9]+$/', $value) ? $default_value : $value;
}
/**
@@ -218,6 +218,7 @@ class Router extends Base
list($this->controller, $this->action) = $this->findRoute($this->getPath($uri, $query_string)); // TODO: add plugin for routes
$plugin = '';
}
+
$class = empty($plugin) ? '\Controller\\'.ucfirst($this->controller) : '\Plugin\\'.ucfirst($plugin).'\Controller\\'.ucfirst($this->controller);
$instance = new $class($this->container);