[BUGFIX] Bugfixes

- getUri() method in Request class no longer appends "/".
- Optimised parseParameters method in RouterRoute class for regex matches.
This commit is contained in:
Simon Sessingø
2015-10-25 15:29:14 +01:00
parent ac2993f804
commit 5e5a424ee8
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ class Request {
public function __construct() {
$this->host = $_SERVER['HTTP_HOST'];
$this->uri = rtrim($_SERVER['REQUEST_URI'], '/') . '/';
$this->uri = $_SERVER['REQUEST_URI'];
$this->method = (isset($_POST['_method'])) ? strtolower($_POST['_method']) : strtolower($_SERVER['REQUEST_METHOD']);
$this->headers = getallheaders();
}
+1
View File
@@ -19,6 +19,7 @@ class RouterRoute extends RouterEntry {
}
protected function parseParameters($url, $multiple = false, $regex = self::PARAMETERS_REGEX_MATCH) {
$url = rtrim($url, '/');
$parameters = array();
if($multiple) {