aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/search/fulltext_sphinx.php
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2017-09-16 23:51:39 +0700
committerrxu <rxu@mail.ru>2017-09-16 23:54:25 +0700
commitca5678cc1c2a1f723d39127e0c066eba6c9a3336 (patch)
tree245b21642c134c4509e46fab60d130065e123624 /phpBB/phpbb/search/fulltext_sphinx.php
parentcd14b2cdf85bd458cb94b780bdf984c485034237 (diff)
downloadforums-ca5678cc1c2a1f723d39127e0c066eba6c9a3336.tar
forums-ca5678cc1c2a1f723d39127e0c066eba6c9a3336.tar.gz
forums-ca5678cc1c2a1f723d39127e0c066eba6c9a3336.tar.bz2
forums-ca5678cc1c2a1f723d39127e0c066eba6c9a3336.tar.xz
forums-ca5678cc1c2a1f723d39127e0c066eba6c9a3336.zip
[ticket/15367] Escape special characters in Sphinx search backend
PHPBB3-15367
Diffstat (limited to 'phpBB/phpbb/search/fulltext_sphinx.php')
-rw-r--r--phpBB/phpbb/search/fulltext_sphinx.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/phpBB/phpbb/search/fulltext_sphinx.php b/phpBB/phpbb/search/fulltext_sphinx.php
index 89c615e087..59c3d55076 100644
--- a/phpBB/phpbb/search/fulltext_sphinx.php
+++ b/phpBB/phpbb/search/fulltext_sphinx.php
@@ -648,7 +648,7 @@ class fulltext_sphinx
$this->sphinx->SetFilter('deleted', array(0));
$this->sphinx->SetLimits($start, (int) $per_page, SPHINX_MAX_MATCHES);
- $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
// Could be connection to localhost:9312 failed (errno=111,
// msg=Connection refused) during rotate, retry if so
@@ -656,7 +656,7 @@ class fulltext_sphinx
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
{
usleep(SPHINX_CONNECT_WAIT_TIME);
- $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
}
if ($this->sphinx->GetLastError())
@@ -679,7 +679,7 @@ class fulltext_sphinx
$start = floor(($result_count - 1) / $per_page) * $per_page;
$this->sphinx->SetLimits((int) $start, (int) $per_page, SPHINX_MAX_MATCHES);
- $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
// Could be connection to localhost:9312 failed (errno=111,
// msg=Connection refused) during rotate, retry if so
@@ -687,7 +687,7 @@ class fulltext_sphinx
while (!$result && (strpos($this->sphinx->GetLastError(), "errno=111,") !== false) && $retries--)
{
usleep(SPHINX_CONNECT_WAIT_TIME);
- $result = $this->sphinx->Query($search_query_prefix . str_replace('&quot;', '"', $this->search_query), $this->indexes);
+ $result = $this->sphinx->Query($search_query_prefix . $this->sphinx->EscapeString(str_replace('&quot;', '"', $this->search_query)), $this->indexes);
}
}