aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB
diff options
context:
space:
mode:
authorDhruv Goel <dhruv.goel92@gmail.com>2012-07-03 03:54:01 +0530
committerunknown <Dhruv@Dhruv-XPS.(none)>2012-07-08 01:38:53 +0530
commit70a0caee28559bd1bd52b4ecf9d7d33acd732fe2 (patch)
treefa195ebb12e96aeb050cb24d6942262092fe5604 /phpBB
parent7a2d36a25eead0a836b7c79ec675a417a2ff5ea6 (diff)
downloadforums-70a0caee28559bd1bd52b4ecf9d7d33acd732fe2.tar
forums-70a0caee28559bd1bd52b4ecf9d7d33acd732fe2.tar.gz
forums-70a0caee28559bd1bd52b4ecf9d7d33acd732fe2.tar.bz2
forums-70a0caee28559bd1bd52b4ecf9d7d33acd732fe2.tar.xz
forums-70a0caee28559bd1bd52b4ecf9d7d33acd732fe2.zip
[feature/postgresql-fulltext-search] supports_phrase_search function
function to return the value of the the private property phrase_search PHPBB3-9730
Diffstat (limited to 'phpBB')
-rw-r--r--phpBB/includes/search/fulltext_postgres.php14
-rw-r--r--phpBB/search.php4
2 files changed, 15 insertions, 3 deletions
diff --git a/phpBB/includes/search/fulltext_postgres.php b/phpBB/includes/search/fulltext_postgres.php
index 79c8035438..84ce674564 100644
--- a/phpBB/includes/search/fulltext_postgres.php
+++ b/phpBB/includes/search/fulltext_postgres.php
@@ -27,10 +27,10 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
private $tsearch_usable = false;
private $version;
private $tsearch_query;
+ private $phrase_search = false;
public $search_query;
public $common_words = array();
public $word_length = array();
- public $phrase_search = false;
/**
* Constructor
@@ -71,6 +71,18 @@ class phpbb_search_fulltext_postgres extends phpbb_search_base
}
/**
+ * Returns if phrase search is supported or not
+ *
+ * @return bool
+ *
+ * @access public
+ */
+ public function supports_phrase_search()
+ {
+ return $this->phrase_search;
+ }
+
+ /**
* Checks for correct PostgreSQL version and stores min/max word length in the config
*
* @return string|bool Language key of the error/incompatiblity occured
diff --git a/phpBB/search.php b/phpBB/search.php
index c93dbdfd34..1123d7c5b9 100644
--- a/phpBB/search.php
+++ b/phpBB/search.php
@@ -598,9 +598,9 @@ if ($keywords || $author || $author_id || $search_id || $submit)
// Check if search backend supports phrase search or not
$phrase_search_disabled = '';
- if (strpos(html_entity_decode($keywords), '"') !== false && isset($search->phrase_search))
+ if (strpos(html_entity_decode($keywords), '"') !== false && method_exists($search, 'supports_phrase_search'))
{
- $phrase_search_disabled = $search->phrase_search ? false : true;
+ $phrase_search_disabled = $search->supports_phrase_search() ? false : true;
}
$template->assign_vars(array(