mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 00:37:52 +00:00
[BUGFIX] Bugfixes
- getUri() method in Request class no longer appends "/". - Optimised parseParameters method in RouterRoute class for regex matches.
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user