aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2009-04-12 13:21:25 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2009-04-12 13:21:25 +0000
commite35b5c26e6a3f2a8a764899eb0b03495aac284e0 (patch)
tree5dbf7026d1184abff76cc5a6f3070e2d9ba0a6fc /phpBB/includes
parent0319733ea8e9dd5225fc9169bb3a063bf29bcd9c (diff)
downloadforums-e35b5c26e6a3f2a8a764899eb0b03495aac284e0.tar
forums-e35b5c26e6a3f2a8a764899eb0b03495aac284e0.tar.gz
forums-e35b5c26e6a3f2a8a764899eb0b03495aac284e0.tar.bz2
forums-e35b5c26e6a3f2a8a764899eb0b03495aac284e0.tar.xz
forums-e35b5c26e6a3f2a8a764899eb0b03495aac284e0.zip
Fix skipping messages if using next/prev PM in history links. (Bug #22205)
git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9441 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/functions_admin.php2
-rw-r--r--phpBB/includes/functions_privmsgs.php11
2 files changed, 10 insertions, 3 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php
index 7aaff2a562..79282c0358 100644
--- a/phpBB/includes/functions_admin.php
+++ b/phpBB/includes/functions_admin.php
@@ -664,6 +664,8 @@ function delete_posts($where_type, $where_ids, $auto_sync = true, $posted_sync =
{
delete_posts($where_type, $_where_ids, $auto_sync, $posted_sync, $post_count_sync, $call_delete_topics);
}
+
+ return;
}*/
$where_clause = $db->sql_in_set($where_type, $where_ids);
diff --git a/phpBB/includes/functions_privmsgs.php b/phpBB/includes/functions_privmsgs.php
index 0b02da054a..05653f7e3b 100644
--- a/phpBB/includes/functions_privmsgs.php
+++ b/phpBB/includes/functions_privmsgs.php
@@ -1763,8 +1763,14 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
$url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm');
$next_history_pm = $previous_history_pm = $prev_id = 0;
- foreach ($rowset as $id => $row)
+ // Re-order rowset to be able to get the next/prev message rows...
+ $rowset = array_values($rowset);
+
+ for ($i = 0, $size = sizeof($rowset); $i < $size; $i++)
{
+ $row = &$rowset[$i];
+ $id = (int) $row['msg_id'];
+
$author_id = $row['author_id'];
$folder_id = (int) $row['folder_id'];
@@ -1795,8 +1801,7 @@ function message_history($msg_id, $user_id, $message_row, $folder, $in_post_mode
if ($id == $msg_id)
{
- $next_history_pm = next($rowset);
- $next_history_pm = (sizeof($next_history_pm)) ? (int) $next_history_pm['msg_id'] : 0;
+ $next_history_pm = (isset($rowset[$i + 1])) ? (int) $rowset[$i + 1]['msg_id'] : 0;
$previous_history_pm = $prev_id;
}