Replace emptiness check of $this->routeData with strict comparison in LookupRequestRoute
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 22 Jun 2022 13:33:56 +0000 (15:33 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 22 Jun 2022 13:33:56 +0000 (15:33 +0200)
wcfsetup/install/files/lib/system/request/route/LookupRequestRoute.class.php

index d9efbef099f8b6c611414f7d09aea8e9bce597fc..2a1bf0e1ea624401c9ceab03019e2f6a68736771 100644 (file)
@@ -59,14 +59,14 @@ class LookupRequestRoute implements IRequestRoute
                 );
 
                 // lookup WCF controllers unless initial request targeted WCF itself
-                if (empty($this->routeData) && $application !== 'wcf') {
+                if ($this->routeData === [] && $application !== 'wcf') {
                     $this->routeData = ControllerMap::getInstance()->resolveCustomController(
                         'wcf',
                         FileUtil::removeTrailingSlash($matches['controller'])
                     );
                 }
 
-                if (!empty($this->routeData)) {
+                if ($this->routeData !== []) {
                     if (!empty($matches['id'])) {
                         $this->routeData['id'] = $matches['id'];
 
@@ -77,7 +77,7 @@ class LookupRequestRoute implements IRequestRoute
                 }
             }
 
-            if (empty($this->routeData)) {
+            if ($this->routeData === []) {
                 // try to match the entire url
                 $this->routeData = ControllerMap::getInstance()->resolveCustomController(
                     $application,
@@ -85,7 +85,7 @@ class LookupRequestRoute implements IRequestRoute
                 );
 
                 // lookup WCF controllers unless initial request targeted WCF itself
-                if (empty($this->routeData) && $application !== 'wcf') {
+                if ($this->routeData === [] && $application !== 'wcf') {
                     $this->routeData = ControllerMap::getInstance()->resolveCustomController(
                         'wcf',
                         FileUtil::removeTrailingSlash($requestURL)
@@ -94,7 +94,7 @@ class LookupRequestRoute implements IRequestRoute
             }
         }
 
-        if (!empty($this->routeData)) {
+        if ($this->routeData !== []) {
             $this->routeData['isDefaultController'] = false;
 
             return true;