Filter all keys starting with underscore
This commit is contained in:
parent
27d3939d30
commit
343ecdfa0f
@ -46,10 +46,10 @@ class Router implements HttpServerInterface {
|
||||
if (!($route['_controller'] instanceof HttpServerInterface)) {
|
||||
throw new \UnexpectedValueException('All routes must implement Ratchet\Http\HttpServerInterface');
|
||||
}
|
||||
|
||||
|
||||
$parameters = array();
|
||||
foreach($route as $key => $value) {
|
||||
if (!in_array($key, array('_controller', '_route'))) {
|
||||
if ((is_string($key)) && ('_' !== substr($key, 0, 1))) {
|
||||
$parameters[$key] = $value;
|
||||
}
|
||||
}
|
||||
@ -100,4 +100,4 @@ class Router implements HttpServerInterface {
|
||||
$conn->send((string)$response);
|
||||
$conn->close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user