Filter all keys starting with underscore

This commit is contained in:
Laurynas Veržukauskas 2014-03-18 22:23:36 +02:00
parent 27d3939d30
commit 343ecdfa0f

View File

@ -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();
}
}
}