Feature request: allow - (minus) sign in front of a word in search to signify to exclude matching results

This commit is contained in:
Latif Khalifa
2013-10-13 11:17:55 +02:00
parent 8ccc4986ac
commit d3d9866354

View File

@@ -84,7 +84,14 @@ class SearchFilter
$parts = preg_split("/\\s+/", trim($this->stacktrace));
foreach($parts as $part)
{
$cond[] = kl_str_sql("raw_stacktrace like !s", "%{$part}%");
if ($part[0] == "-")
{
$cond[] = kl_str_sql("raw_stacktrace not like !s", "%" . substr($part, 1) . "%");
}
else
{
$cond[] = kl_str_sql("raw_stacktrace like !s", "%{$part}%");
}
}
}