aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2008-06-04 17:25:50 +0000
committerNils Adermann <naderman@naderman.de>2008-06-04 17:25:50 +0000
commitfb1d71bd05edd34c49cc498d34fdfc15bf341672 (patch)
tree8c847bdfc427ee2465a922df896edfb8daf61971 /phpBB/includes
parentfe80d95e8da99242d98b689840d93ed749de67fb (diff)
downloadforums-fb1d71bd05edd34c49cc498d34fdfc15bf341672.tar
forums-fb1d71bd05edd34c49cc498d34fdfc15bf341672.tar.gz
forums-fb1d71bd05edd34c49cc498d34fdfc15bf341672.tar.bz2
forums-fb1d71bd05edd34c49cc498d34fdfc15bf341672.tar.xz
forums-fb1d71bd05edd34c49cc498d34fdfc15bf341672.zip
Topic searches by author no longer return invalid results [Bug #11777]
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@8604 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/search/fulltext_mysql.php4
-rw-r--r--phpBB/includes/search/fulltext_native.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/phpBB/includes/search/fulltext_mysql.php b/phpBB/includes/search/fulltext_mysql.php
index 1cd28fc6d2..80724fb5c5 100644
--- a/phpBB/includes/search/fulltext_mysql.php
+++ b/phpBB/includes/search/fulltext_mysql.php
@@ -546,8 +546,8 @@ class fulltext_mysql extends search_backend
break;
case 't':
- $sql_sort_table = ($type == 'posts') ? TOPICS_TABLE . ' t, ' : '';
- $sql_sort_join = ($type == 'posts') ? ' AND t.topic_id = p.topic_id ' : '';
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
break;
case 'f':
diff --git a/phpBB/includes/search/fulltext_native.php b/phpBB/includes/search/fulltext_native.php
index bfcb02f8e6..b0e95a1559 100644
--- a/phpBB/includes/search/fulltext_native.php
+++ b/phpBB/includes/search/fulltext_native.php
@@ -813,8 +813,8 @@ class fulltext_native extends search_backend
break;
case 't':
- $sql_sort_table = ($type == 'posts') ? TOPICS_TABLE . ' t, ' : '';
- $sql_sort_join = ($type == 'posts') ? ' AND t.topic_id = p.topic_id ' : '';
+ $sql_sort_table = ($type == 'posts' && !$firstpost_only) ? TOPICS_TABLE . ' t, ' : '';
+ $sql_sort_join = ($type == 'posts' && !$firstpost_only) ? ' AND t.topic_id = p.topic_id ' : '';
break;
case 'f':
@@ -900,7 +900,7 @@ class fulltext_native extends search_backend
if ($type == 'posts')
{
$sql = "SELECT $select
- FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($topic_id || $firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
+ FROM " . $sql_sort_table . POSTS_TABLE . ' p' . (($firstpost_only) ? ', ' . TOPICS_TABLE . ' t' : '') . "
WHERE $sql_author
$sql_topic_id
$sql_firstpost