Skip to content

Commit

Permalink
Router: Check directly for RouterInterface (joomla#43119)
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackwar authored and dgrammatiko committed Oct 17, 2024
1 parent 4b39c17 commit bcaa681
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions libraries/src/Router/SiteRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,9 +588,7 @@ public function getComponentRouter($component)
*/
public function setComponentRouter($component, $router)
{
$reflection = new \ReflectionClass($router);

if (\in_array('Joomla\\CMS\\Component\\Router\\RouterInterface', $reflection->getInterfaceNames())) {
if ($router instanceof RouterInterface) {
$this->componentRouters[$component] = $router;

return true;
Expand Down

0 comments on commit bcaa681

Please sign in to comment.