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