Optimize legibility of if condition which checks against numbers
authorJoshua Rüsweg <ruesweg@woltlab.com>
Wed, 28 Aug 2019 19:20:36 +0000 (21:20 +0200)
committerJoshua Rüsweg <ruesweg@woltlab.com>
Wed, 28 Aug 2019 19:20:44 +0000 (21:20 +0200)
wcfsetup/install/files/lib/acp/page/ModificationLogListPage.class.php

index 97fbb8aa35c4258efcd5c9ca481adbd8071ae71f..939fea69a36e835b097bd98e18417691f9ccc550 100644 (file)
@@ -192,7 +192,7 @@ class ModificationLogListPage extends SortablePage {
                        $packageID = 0;
                        
                        // an integer signals all actions from the package with the relevant id
-                       if ($this->action == strval(intval($this->action))) {
+                       if (preg_match('/^[0-9]+$/', $this->action)) {
                                $packageID = $this->action;
                        }
                        else if (preg_match('~^(?P<objectType>.+)\-(?P<action>[^\-]+)$~', $this->action, $matches)) {