diff --git a/src/Router/Core.php b/src/Router/Core.php index 4779ca6..6b5018d 100644 --- a/src/Router/Core.php +++ b/src/Router/Core.php @@ -378,7 +378,7 @@ private static function findRoute( // Extract the matched URL parameters (and only the parameters) $params = array_map(function ($match, $index) use ($matches) { // We have a following parameter: take the substring from the current param position until the next one's position (thank you PREG_OFFSET_CAPTURE) - if (isset($matches[$index + 1]) && isset($matches[$index + 1][0]) && is_array($matches[$index + 1][0])) { + if (isset($matches[$index + 1]) && isset($matches[$index + 1][0]) && $matches[$index + 1][0][1] != -1 && is_array($matches[$index + 1][0])) { return trim(substr($match[0][0], 0, $matches[$index + 1][0][1] - $match[0][1]), '/'); }