mitigate accidental method route traversal
This commit is contained in:
parent
17bf93874b
commit
012d306d3a
@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "sharkk/router",
|
||||
"description": "A simple node-based router.",
|
||||
"version": "1.2.6",
|
||||
"version": "1.2.7",
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"autoload": {
|
||||
|
@ -71,8 +71,8 @@ class Router
|
||||
|
||||
// we'll split up the URI into segments and traverse the node tree
|
||||
foreach (explode('/', trim($uri, '/')) as $segment) {
|
||||
// if there is a node for this segment, move to it
|
||||
if (isset($node[$segment])) {
|
||||
// check that the next segment is an array (not a callable) and exists, then move to it
|
||||
if (isset($node[$segment]) && is_array($node[$segment])) {
|
||||
$node = $node[$segment];
|
||||
continue;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user