Skip to content

Commit ef93a54

Browse files
committed
🔨 improve createRoute method
Signed-off-by: otengkwame <[email protected]>
1 parent 20feb9c commit ef93a54

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Core/core/Route/Route.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,12 @@ protected static function createRoute($from, $to, $options = [], $nested = false
463463
$parameterfy = true;
464464
}
465465

466+
// If $to still contains ->|@|::
467+
// replace them with /
468+
if ( preg_match("/(->|@|::)/i", $to) ) {
469+
$to = str_replace(['->', '::', '@'], ['/', '/', '/'], $to);
470+
}
471+
466472
// Do we have a namespace?
467473
if (static::$namespace) {
468474
$from = static::$namespace . '/' . $from;

0 commit comments

Comments
 (0)