Commit 279acbb0 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

fixed a bug in the new phrase search

parent 64f791ad
......@@ -566,7 +566,7 @@ class MetaGer
$filter = rtrim($filter, ",");
$error = trans('metaGer.engines.noSpecialSearch', [
'fokus' => trans($this->sumaFile->foki->{$this->fokus}->{"display-name"}),
'filter' => $filter
'filter' => $filter,
]);
$this->errors[] = $error;
}
......@@ -1227,14 +1227,14 @@ class MetaGer
// matches '[... ]-test[ ...]'
$words = preg_split("/\s+/si", $tmp);
$newQ = "";
$newQ = $this->q;
foreach ($words as $word) {
if (strpos($word, "-") === 0 && strlen($word) > 1) {
$this->stopWords[] = substr($word, 1);
} else {
$newQ .= " " . $word;
$newQ = str_ireplace($word, "", $newQ);
}
}
$newQ = preg_replace("/(\s)\s+/", "$1", $newQ);
$this->q = trim($newQ);
# Overwrite Setting if submitted via Parameter
if ($request->has('stop')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment