aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenry Sudhof <kellanved@phpbb.com>2007-05-09 10:00:57 +0000
committerHenry Sudhof <kellanved@phpbb.com>2007-05-09 10:00:57 +0000
commit3eedb3fb470d7533209987db06febfc98c2b0e1d (patch)
treea7203ba038e991cec36377325c7244913605797e
parent7a6bd82cd0004465f00199048531faaf2b4da3ee (diff)
downloadforums-3eedb3fb470d7533209987db06febfc98c2b0e1d.tar
forums-3eedb3fb470d7533209987db06febfc98c2b0e1d.tar.gz
forums-3eedb3fb470d7533209987db06febfc98c2b0e1d.tar.bz2
forums-3eedb3fb470d7533209987db06febfc98c2b0e1d.tar.xz
forums-3eedb3fb470d7533209987db06febfc98c2b0e1d.zip
#10669
git-svn-id: file:///svn/phpbb/trunk@7509 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r--phpBB/includes/functions_posting.php6
1 files changed, 3 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php
index 2b2f7a8ced..e7615b8563 100644
--- a/phpBB/includes/functions_posting.php
+++ b/phpBB/includes/functions_posting.php
@@ -1933,7 +1933,7 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
{
// edit_last_post does not _necessarily_ mean that we must update the info again,
// it just means that we might have to
- $sql = 'SELECT forum_last_post_id
+ $sql = 'SELECT forum_last_post_id, forum_last_post_subject
FROM ' . FORUMS_TABLE . '
WHERE forum_id = ' . (int) $data['forum_id'];
$result = $db->sql_query($sql);
@@ -1941,10 +1941,10 @@ function submit_post($mode, $subject, $username, $topic_type, &$poll, &$data, $u
$db->sql_freeresult($result);
// this post is the last post in the forum, better update
- if ($row['forum_last_post_id'] == $data['post_id'])
+ if ($row['forum_last_post_id'] == $data['post_id'] && $row['forum_last_post_subject'] !== $subject)
{
// the only data that can really be changed is the post's subject
- $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = ' . $db->sql_escape($subject);
+ $sql_data[FORUMS_TABLE]['stat'][] = 'forum_last_post_subject = \'' . $db->sql_escape($subject) . '\'';
}
}
}