Small optimization
authorMarcel Werk <burntime@woltlab.com>
Mon, 24 Jun 2013 16:46:08 +0000 (18:46 +0200)
committerMarcel Werk <burntime@woltlab.com>
Mon, 24 Jun 2013 16:46:08 +0000 (18:46 +0200)
wcfsetup/install/files/lib/form/SearchForm.class.php

index 109bc4cc02e09e75683305afbe6576286dda7b6d..9e27df66b9923e029e3bcea40860429283f7e136 100644 (file)
@@ -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())) {