BUGFIX: SSF-124 filter on a value only if this value is not an empty string

This commit is contained in:
Normann Lou 2012-04-11 12:12:57 +12:00
parent bfb81fb89f
commit 3d0566638a

View File

@ -185,7 +185,7 @@ class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter {
switch($name) {
// Match against URLSegment, Title, MenuTitle & Content
case 'Term':
$where[] = "\"URLSegment\" LIKE '%$val%' OR \"Title\" LIKE '%$val%' OR \"MenuTitle\" LIKE '%$val%' OR \"Content\" LIKE '%$val%'";
if($val) $where[] = "\"URLSegment\" LIKE '%$val%' OR \"Title\" LIKE '%$val%' OR \"MenuTitle\" LIKE '%$val%' OR \"Content\" LIKE '%$val%'";
break;
// Match against date
case 'LastEditedFrom':