aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_posting.php
diff options
context:
space:
mode:
author3Di <three3di@hotmail.it>2019-03-23 05:09:17 +0100
committerGitHub <noreply@github.com>2019-03-23 05:09:17 +0100
commit6921565efe4674c51eb08326313cfca3349eedd5 (patch)
treedabee12a9a81fe778be6769c5f1abc5be36ab9cf /phpBB/includes/functions_posting.php
parent6c1664f6d3b85c1b4d620870444c8f4b82b08e57 (diff)
parent0d04f53f374db12a1a285992a9c789a836848b3e (diff)
downloadforums-6921565efe4674c51eb08326313cfca3349eedd5.tar
forums-6921565efe4674c51eb08326313cfca3349eedd5.tar.gz
forums-6921565efe4674c51eb08326313cfca3349eedd5.tar.bz2
forums-6921565efe4674c51eb08326313cfca3349eedd5.tar.xz
forums-6921565efe4674c51eb08326313cfca3349eedd5.zip
Merge branch '3.2.x' into ticket/15948
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r--phpBB/includes/functions_posting.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index c7d691287c..3640f543d9 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -202,11 +202,13 @@ function update_post_information($type, $ids, $return_update_sql = false)
if (count($ids) == 1)
{
- $sql = 'SELECT MAX(p.post_id) as last_post_id
+ $sql = 'SELECT p.post_id as last_post_id
FROM ' . POSTS_TABLE . " p $topic_join
WHERE " . $db->sql_in_set('p.' . $type . '_id', $ids) . "
$topic_condition
- AND p.post_visibility = " . ITEM_APPROVED;
+ AND p.post_visibility = " . ITEM_APPROVED . "
+ ORDER BY p.post_id DESC";
+ $result = $db->sql_query_limit($sql, 1);
}
else
{
@@ -216,8 +218,8 @@ function update_post_information($type, $ids, $return_update_sql = false)
$topic_condition
AND p.post_visibility = " . ITEM_APPROVED . "
GROUP BY p.{$type}_id";
+ $result = $db->sql_query($sql);
}
- $result = $db->sql_query($sql);
$last_post_ids = array();
while ($row = $db->sql_fetchrow($result))