From: Marcel Werk Date: Mon, 24 Jun 2013 16:46:08 +0000 (+0200) Subject: Small optimization X-Git-Tag: 2.0.0_Beta_5~144 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=45201e26ed0f5c9d0940571cb49a5685e28c6664;p=GitHub%2FWoltLab%2FWCF.git Small optimization --- diff --git a/wcfsetup/install/files/lib/form/SearchForm.class.php b/wcfsetup/install/files/lib/form/SearchForm.class.php index 109bc4cc02..9e27df66b9 100644 --- a/wcfsetup/install/files/lib/form/SearchForm.class.php +++ b/wcfsetup/install/files/lib/form/SearchForm.class.php @@ -395,9 +395,17 @@ class SearchForm extends RecaptchaForm { } // dates - if (($startDate = @strtotime($this->startDate)) && ($endDate = @strtotime($this->endDate))) { + $startDate = @strtotime($this->startDate); + $endDate = @strtotime($this->endDate); + if ($startDate && $endDate) { $this->searchIndexCondition->add('time BETWEEN ? AND ?', array($startDate, $endDate)); } + else if ($startDate) { + $this->searchIndexCondition->add('time > ?', array($startDate)); + } + else if ($endDate) { + $this->searchIndexCondition->add('time < ?', array($endDate)); + } // language if (!empty($this->query) && LanguageFactory::getInstance()->multilingualismEnabled() && count(WCF::getUser()->getLanguageIDs())) {