From 439d94a20aac1a583c645840cf729ce2a1aca888 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sat, 10 Dec 2016 19:07:49 +0100 Subject: [PATCH] Fixed some legacy urls These two URLs were purposely not generated in the expected fashion due to their special purposes, but they were both abusing a non-standard behavior that is no longer possible due to a recent change. --- .../acp/action/InstallPackageAction.class.php | 24 ++----------------- .../files/lib/form/SearchForm.class.php | 16 +------------ 2 files changed, 3 insertions(+), 37 deletions(-) diff --git a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php index 15e6884546..c491d7e1d5 100755 --- a/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php +++ b/wcfsetup/install/files/lib/acp/action/InstallPackageAction.class.php @@ -88,38 +88,18 @@ class InstallPackageAction extends AbstractDialogAction { $this->installation->completeSetup(); $this->finalize(); - switch (PACKAGE_ID) { - // redirect to application if not already within one - case 0: // during WCFSetup - case 1: - // select first installed application - $sql = "SELECT packageID - FROM wcf".WCF_N."_package - WHERE packageID <> 1 - AND isApplication = 1 - ORDER BY installDate ASC"; - $statement = WCF::getDB()->prepareStatement($sql, 1); - $statement->execute(); - $row = $statement->fetchArray(); - $packageID = ($row === false) ? 1 : $row['packageID']; - break; - - default: - $packageID = PACKAGE_ID; - break; - } - // get domain path $sql = "SELECT * FROM wcf".WCF_N."_application WHERE packageID = ?"; $statement = WCF::getDB()->prepareStatement($sql); - $statement->execute([$packageID]); + $statement->execute([1]); /** @var Application $application */ $application = $statement->fetchObject(Application::class); // build redirect location + // do not use the LinkHandler here as it is sort of unreliable during WCFSetup $location = $application->getPageURL() . 'acp/index.php?package-list/'; WCF::resetZendOpcache(); diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index 7cd697e34d..ad05833832 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -2,7 +2,6 @@ namespace wcf\form; use wcf\data\search\Search; use wcf\data\search\SearchAction; -use wcf\system\application\ApplicationHandler; use wcf\system\exception\IllegalLinkException; use wcf\system\exception\NamedUserException; use wcf\system\exception\PermissionDeniedException; @@ -375,21 +374,8 @@ class SearchForm extends AbstractCaptchaForm { } $this->saved(); - // get application - $application = 'wcf'; - if (count($this->selectedObjectTypes) == 1) { - $objectType = SearchEngine::getInstance()->getObjectType(reset($this->selectedObjectTypes)); - /** @noinspection PhpUndefinedFieldInspection */ - if ($tmp = ApplicationHandler::getInstance()->getAbbreviation($objectType->packageID)) { - $application = $tmp; - } - } - // forward to result page - HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', [ - 'id' => $this->searchID, - 'application' => $application - ], 'highlight='.urlencode($this->query))); + HeaderUtil::redirect(LinkHandler::getInstance()->getLink('SearchResult', ['id' => $this->searchID], 'highlight='.urlencode($this->query))); exit; } -- 2.20.1