Skip to content
Snippets Groups Projects
Commit bcca3059 authored by Dominik Hebeler's avatar Dominik Hebeler
Browse files

Merge branch 'development' into 'master'

Development

See merge request !1471
parents 3bff5df1 64f791ad
No related branches found
No related tags found
2 merge requests!1504Master,!1471Development
...@@ -63,6 +63,7 @@ class MetaGer ...@@ -63,6 +63,7 @@ class MetaGer
protected $adUrlsBlacklisted = []; protected $adUrlsBlacklisted = [];
protected $url; protected $url;
protected $fullUrl; protected $fullUrl;
protected $enabledSearchengines = [];
protected $languageDetect; protected $languageDetect;
protected $verificationId; protected $verificationId;
protected $verificationCount; protected $verificationCount;
...@@ -1116,6 +1117,7 @@ class MetaGer ...@@ -1116,6 +1117,7 @@ class MetaGer
$tmp = $match[1] . $match[3]; $tmp = $match[1] . $match[3];
$this->phrases[] = $match[2]; $this->phrases[] = $match[2];
} }
foreach ($this->phrases as $phrase) { foreach ($this->phrases as $phrase) {
$p .= "\"$phrase\", "; $p .= "\"$phrase\", ";
} }
...@@ -1215,8 +1217,16 @@ class MetaGer ...@@ -1215,8 +1217,16 @@ class MetaGer
private function searchCheckStopwords($request) private function searchCheckStopwords($request)
{ {
$oldQ = $this->q; $oldQ = $this->q;
$tmp = $this->q;
// matches '[... ]"test satz"[ ...]'
// In order to avoid "finding" stopwords inside of phrase searches only strings outside of quotation marks should be checked
while (preg_match("/(^|.*?\s)\"(.+)\"(\s.*|$)/si", $tmp, $match)) {
$tmp = $match[1] . $match[3];
}
// matches '[... ]-test[ ...]' // matches '[... ]-test[ ...]'
$words = preg_split("/\s+/si", $this->q); $words = preg_split("/\s+/si", $tmp);
$newQ = ""; $newQ = "";
foreach ($words as $word) { foreach ($words as $word) {
if (strpos($word, "-") === 0 && strlen($word) > 1) { if (strpos($word, "-") === 0 && strlen($word) > 1) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment