Add missing validation in EditHistoryPage
authorTim Düsterhus <duesterhus@woltlab.com>
Wed, 9 Jul 2014 18:22:58 +0000 (20:22 +0200)
committerTim Düsterhus <duesterhus@woltlab.com>
Wed, 9 Jul 2014 19:59:02 +0000 (21:59 +0200)
wcfsetup/install/files/lib/page/EditHistoryPage.class.php

index c692cbb2684b50b639264fd1c30e85f9b5ef8fac..2094ebcda7789a53a3f2bd3355a3925bd1b3f8f4 100644 (file)
@@ -116,13 +116,14 @@ class EditHistoryPage extends AbstractPage {
                }
                
                $this->objectType = ObjectTypeCache::getInstance()->getObjectType($this->objectTypeID);
+               if (!$this->objectType) throw new IllegalLinkException();
                $processor = $this->objectType->getProcessor();
                $this->object = $processor->getObjectByID($this->objectID);
                $processor->checkPermissions($this->object);
                $this->activeMenuItem = $processor->getActivePageMenuItem();
                $this->object->addBreadcrumbs();
                
-               if (!$this->new) {
+               if (isset($_REQUEST['newID']) && !$this->new) {
                        $this->new = $this->object;
                        $this->newID = 'current';
                }