Fixed parameter validation and missing use tags
authorMarcel Werk <burntime@woltlab.com>
Tue, 9 Aug 2011 17:31:27 +0000 (19:31 +0200)
committerMarcel Werk <burntime@woltlab.com>
Tue, 9 Aug 2011 17:31:27 +0000 (19:31 +0200)
wcfsetup/install/files/lib/acp/form/AbstractOptionListForm.class.php
wcfsetup/install/files/lib/acp/page/PackageViewPage.class.php

index c67fb0c667306dfb18a6edeb97b332f77bdbb756..af830cf6d75620bdfa9dd456fb1f663aa8ccc558 100755 (executable)
@@ -5,6 +5,7 @@ use wcf\data\option\Option;
 use wcf\form\AbstractForm;
 use wcf\system\cache\CacheHandler;
 use wcf\system\exception\SystemException;
+use wcf\system\exception\UserInputException;
 use wcf\util\ClassUtil;
 
 /**
index b91e54b17c54414d530bec8470a0524ed8654c9d..05141b848fec5fc0fdb05904954d37961b909f9e 100755 (executable)
@@ -1,8 +1,9 @@
 <?php
 namespace wcf\acp\page;
-use wcf\system\menu\acp\ACPMenu;
 use wcf\data\package\Package;
 use wcf\page\AbstractPage;
+use wcf\system\menu\acp\ACPMenu;
+use wcf\system\exception\IllegalLinkException;
 use wcf\system\WCF;
 
 /**
@@ -64,6 +65,10 @@ class PackageViewPage extends AbstractPage {
                parent::readParameters();
                
                if (isset($_REQUEST['packageID'])) $this->packageID = intval($_REQUEST['packageID']);
+               $this->package = new Package($this->packageID);
+               if (!$this->package->packageID) {
+                       throw new IllegalLinkException();
+               }
        }
        
        /**
@@ -73,15 +78,9 @@ class PackageViewPage extends AbstractPage {
                parent::readData();
                
                // get package data
-               try {
-                       $this->package = new Package($this->packageID);
-                       $this->requiredPackages = $this->package->getRequiredPackages();
-                       $this->dependentPackages = $this->package->getDependentPackages();
-                       $this->dependencies = $this->package->getDependencies();
-               }
-               catch (SystemException $e) {
-                       throw new IllegalLinkException();
-               }
+               $this->requiredPackages = $this->package->getRequiredPackages();
+               $this->dependentPackages = $this->package->getDependentPackages();
+               $this->dependencies = $this->package->getDependencies();
        }
        
        /**