Merge pull request #5997 from marc1706/ticket/16507

[ticket/16507] Fix incorrect call to sphinx_clean_search_string()
This commit is contained in:
Marc Alexander 2020-06-02 10:48:31 +02:00
commit e65c0171e4
No known key found for this signature in database
GPG key ID: 50E0D2423696F995

View file

@ -711,7 +711,7 @@ class fulltext_sphinx
$this->sphinx->SetFilter('deleted', array(0)); $this->sphinx->SetFilter('deleted', array(0));
$this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page)); $this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page));
$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes);
// Could be connection to localhost:9312 failed (errno=111, // Could be connection to localhost:9312 failed (errno=111,
// msg=Connection refused) during rotate, retry if so // msg=Connection refused) during rotate, retry if so
@ -719,7 +719,7 @@ class fulltext_sphinx
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
{ {
usleep(SPHINX_CONNECT_WAIT_TIME); usleep(SPHINX_CONNECT_WAIT_TIME);
$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes);
} }
if ($this->sphinx->GetLastError()) if ($this->sphinx->GetLastError())
@ -742,7 +742,7 @@ class fulltext_sphinx
$start = floor(($result_count - 1) / $per_page) * $per_page; $start = floor(($result_count - 1) / $per_page) * $per_page;
$this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page)); $this->sphinx->SetLimits((int) $start, (int) $per_page, max(SPHINX_MAX_MATCHES, (int) $start + $per_page));
$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes);
// Could be connection to localhost:9312 failed (errno=111, // Could be connection to localhost:9312 failed (errno=111,
// msg=Connection refused) during rotate, retry if so // msg=Connection refused) during rotate, retry if so
@ -750,7 +750,7 @@ class fulltext_sphinx
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--) while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
{ {
usleep(SPHINX_CONNECT_WAIT_TIME); usleep(SPHINX_CONNECT_WAIT_TIME);
$result = $this->sphinx->Query($search_query_prefix . $this->sphinx->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes); $result = $this->sphinx->Query($search_query_prefix . $this->sphinx_clean_search_string(str_replace('"', '"', $this->search_query)), $this->indexes);
} }
} }