Skip to content

Commit

Permalink
Improved resolve controller
Browse files Browse the repository at this point in the history
  • Loading branch information
aimeos committed Dec 17, 2023
1 parent d213de6 commit 467e570
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/Controller/ResolveController.php
Expand Up @@ -65,11 +65,13 @@ public function indexAction( \Illuminate\Http\Request $request )

$context = app( 'aimeos.context' )->get( true );

foreach( self::$fcn as $name => $fcn )
foreach( array_reverse( self::$fcn ) as $name => $fcn )
{
try {
return $fcn( $context, $path );
} catch( \Exception $e ) {} // not found
return call_user_func_array( $fcn->bindTo( $this, static::class ), [$context, $path] );
} catch( \Exception $e ) {
if( $e->getCode() !== 404 ) throw $e;
}
}

abort( 404 );
Expand Down

0 comments on commit 467e570

Please sign in to comment.