fix: ignore extraneous slashes in paths
This commit is contained in:
parent
da760ee4a3
commit
5320ba3e11
1 changed files with 2 additions and 3 deletions
|
@ -28,9 +28,8 @@ final class URLMapper
|
|||
|
||||
public function fromPathInfo( )
|
||||
{
|
||||
if ( array_key_exists( 'PATH_INFO' , $_SERVER ) ) {
|
||||
$path = $_SERVER[ 'PATH_INFO' ];
|
||||
} else {
|
||||
$path = rtrim( preg_replace( '/\/\/+/g', '/', $_SERVER[ 'PATH_INFO' ] ?? '') , '/' );
|
||||
if ( !$path ) {
|
||||
$path = '/' . $this->package->config( $this->configBase . '/default' , 'home' );
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue