$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();
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;
}
$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;
}