Skip to content

bug in run() with basepath != '/' ? #12

@marcoas

Description

@marcoas

(Translated by Google)

Hello
I am testing a version modified by me, of ROUTER.PHP
and when I use for example:

Router::add('/', function () {
   echo 'Welcome to v3';
});
Router: run('/v3');

I needed to modify this line in the RUN method

if ($basePath != '/') {
   $route['route'] = self::trimRoute($basePath. $route['route']);
}

Otherwise the path "/" always returned 404
This only happened with the '/' path, the others always worked fine.

Maybe it is really necessary to change it in this repository

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions