Uploaded image for project: 'phpBB'
  1. phpBB
  2. PHPBB-14456

sphinxsearch, possible missed EscapeString for keywords

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • None
    • 3.1.6
    • Search
    • None
    • Debian Wheezy
      PHP 5.4.45, PerconaDB 5.6.27-76.0
      Sphinx 2.0.4-release (r3135)

      When search keywords contains // simbols, for example ".... http:// ....." get search error:

      index index_phpbb_...._delta,index_phpbb_...._main: syntax error, unexpected '/' near '//'
      

      After adding EscapeString function from /includes/sphinxapi.php to file /phpbb/search/fulltext_sphinx.php search returned normal result, found all ".... http:// ...."

      open /phpbb/search/fulltext_sphinx.php
      find

      		$result = $this->sphinx->Query($search_query_prefix . str_replace('"', '"', $this->search_query), $this->indexes);
      

      before add

      		$this->search_query = $this->sphinx->EscapeString($this->search_query);
      

      But it is not correct way, because operator NOT (simbols -, !) was escaped by this function.
      How to fix it? Or may be it is not bug?..

            Unassigned Unassigned
            Siava Siava
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: