append wildcards to search if user did not enter any

This commit is contained in:
Michael Wyraz
2016-08-22 15:55:13 +02:00
parent 818268482e
commit dd4cfebe75

View File

@@ -319,6 +319,8 @@ class paging {
$condition.= $searchfield . " ".$oper." " . Database::quote($searchtext);
} else {
$searchtext = str_replace('*', '%', $this->searchtext);
// append wildcards if user did not enter any
if (strpos($searchtext,'%') === false) $searchtext='%'.$searchtext.'%';
$condition.= $searchfield . " LIKE " . Database::quote($searchtext);
}