Fix route and redirect methods error when path not start with slash.
This commit is contained in:
@ -100,7 +100,7 @@ class Router {
|
||||
*/
|
||||
public static function redirect(string $path): void
|
||||
{
|
||||
header('Location: '.static::basePath().substr($path,1));
|
||||
header('Location: '.static::basePath().ltrim($path, '/'));
|
||||
exit;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user