From 45201e26ed0f5c9d0940571cb49a5685e28c6664 Mon Sep 17 00:00:00 2001 From: Marcel Werk Date: Mon, 24 Jun 2013 18:46:08 +0200 Subject: [PATCH] Small optimization --- wcfsetup/install/files/lib/form/SearchForm.class.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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())) { -- 2.20.1