aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/search
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/search')
-rw-r--r--phpBB/includes/search/fulltext_mysql.php14
-rw-r--r--phpBB/includes/search/fulltext_native.php15
2 files changed, 17 insertions, 12 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index cf89ab1c24..73bf5c52f2 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -265,7 +265,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -292,7 +292,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary)
)));
@@ -354,7 +354,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -366,6 +366,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
$sql_select = (!$result_count) ? 'SQL_CALC_FOUND_ROWS ' : '';
$sql_select = ($type == 'posts') ? $sql_select . 'p.post_id' : 'DISTINCT ' . $sql_select . 't.topic_id';
@@ -445,7 +446,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts a user may view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -473,7 +474,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -523,7 +524,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -535,6 +536,7 @@ class phpbb_search_fulltext_mysql extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
// If the cache was completely empty count the results
$calc_results = ($result_count) ? '' : 'SQL_CALC_FOUND_ROWS ';
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index 96b3f02ec6..c7e7a451e4 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -414,7 +414,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which types of posts the user can view
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids if the author should be ignored during the search the array is empty
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -451,7 +451,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -628,7 +628,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sql_where[] = '(' . implode(' OR ', $is_null_joins) . ')';
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$sql_where[] = 'p.post_approved = 1';
}
@@ -636,6 +636,8 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$sql_where[] = '(p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
+ $sql_where[] = $m_approve_fid_sql;
if ($topic_id)
{
@@ -808,7 +810,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
* @param string $sort_dir is either a or d representing ASC and DESC
* @param string $sort_days specifies the maximum amount of days a post may be old
* @param array $ex_fid_ary specifies an array of forum ids which should not be searched
- * @param array $m_approve_fid_ary specifies an array of forum ids in which the searcher is allowed to view unapproved posts
+ * @param array $m_approve_fid_sql specifies which posts a user can view, based on permissions
* @param int $topic_id is set to 0 or a topic id, if it is not 0 then only posts in this topic should be searched
* @param array $author_ary an array of author ids
* @param string $author_name specifies the author match, when ANONYMOUS is also a search-match
@@ -836,7 +838,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
$sort_key,
$topic_id,
implode(',', $ex_fid_ary),
- implode(',', $m_approve_fid_ary),
+// @TODO implode(',', $m_approve_fid_ary),
implode(',', $author_ary),
$author_name,
)));
@@ -886,7 +888,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
break;
}
- if (!sizeof($m_approve_fid_ary))
+/* if (!sizeof($m_approve_fid_ary))
{
$m_approve_fid_sql = ' AND p.post_approved = 1';
}
@@ -898,6 +900,7 @@ class phpbb_search_fulltext_native extends phpbb_search_base
{
$m_approve_fid_sql = ' AND (p.post_approved = 1 OR ' . $this->db->sql_in_set('p.forum_id', $m_approve_fid_ary, true) . ')';
}
+*/
$select = ($type == 'posts') ? 'p.post_id' : 't.topic_id';
$is_mysql = false;