From d98e3d00d2daf9df7dab552f795ec01946343912 Mon Sep 17 00:00:00 2001 From: Graham Eames Date: Sat, 22 Apr 2006 19:54:44 +0000 Subject: [PATCH] Fix for poll deletion mistakenly altering forum stats [#1602] git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@5833 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions_post.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/functions_post.php b/phpBB/includes/functions_post.php index 077da90cb6..ff7a21983a 100644 --- a/phpBB/includes/functions_post.php +++ b/phpBB/includes/functions_post.php @@ -413,12 +413,15 @@ function update_post_stats(&$mode, &$post_data, &$forum_id, &$topic_id, &$post_i $topic_update_sql .= 'topic_vote = 0'; } - $sql = "UPDATE " . FORUMS_TABLE . " SET - $forum_update_sql - WHERE forum_id = $forum_id"; - if (!$db->sql_query($sql)) + if ($mode != 'poll_delete') { - message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); + $sql = "UPDATE " . FORUMS_TABLE . " SET + $forum_update_sql + WHERE forum_id = $forum_id"; + if (!$db->sql_query($sql)) + { + message_die(GENERAL_ERROR, 'Error in posting', '', __LINE__, __FILE__, $sql); + } } if ($topic_update_sql != '')