check for empty searches

Could we change ```$query == ' '``` to be ```empty(trim($query))```? I think it would be safer.