aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/posting.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2009-07-24 09:01:29 +0000
committerJoas Schilling <nickvergessen@gmx.de>2009-07-24 09:01:29 +0000
commit780854818b22ccdf36fe50e4e4bf5e68027c9e2b (patch)
tree5bbea1b2486ca642d37918aae91c7087c8f05bd5 /phpBB/posting.php
parent433f03107de1162744a1d0b8c9fa3c4ba1b3ed21 (diff)
downloadforums-780854818b22ccdf36fe50e4e4bf5e68027c9e2b.tar
forums-780854818b22ccdf36fe50e4e4bf5e68027c9e2b.tar.gz
forums-780854818b22ccdf36fe50e4e4bf5e68027c9e2b.tar.bz2
forums-780854818b22ccdf36fe50e4e4bf5e68027c9e2b.tar.xz
forums-780854818b22ccdf36fe50e4e4bf5e68027c9e2b.zip
Fix bug #48265 - Correctly set attachment flag for topics, posts and pms after deleting attachments - Patch by WorldWar and nickvergessen
Authorised by: AcydBurn git-svn-id: file:///svn/phpbb/branches/phpBB-3_0_0@9843 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/posting.php')
-rw-r--r--phpBB/posting.php23
1 files changed, 22 insertions, 1 deletions
diff --git a/phpBB/posting.php b/phpBB/posting.php
index 600bf1688c..d304168153 100644
--- a/phpBB/posting.php
+++ b/phpBB/posting.php
@@ -700,7 +700,28 @@ if ($submit || $preview || $refresh)
}
// Parse Attachments - before checksum is calculated
- $message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);
+ if ($mode == 'edit')
+ {
+ $message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh, false, $post_id, $topic_id);
+ if (sizeof($message_parser->attachment_data))
+ {
+ // Update attachment indicators for post/topic having attachments now, as a precaution if the post does not get stored by submit
+ $sql = 'UPDATE ' . POSTS_TABLE . '
+ SET post_attachment = 1
+ WHERE post_id = ' . $post_id;
+ $db->sql_query($sql);
+
+ $sql = 'UPDATE ' . TOPICS_TABLE . '
+ SET topic_attachment = 1
+ WHERE topic_id = ' . $topic_id;
+ $db->sql_query($sql);
+ }
+ }
+ else
+ {
+ $message_parser->parse_attachments('fileupload', $mode, $forum_id, $submit, $preview, $refresh);
+ }
+
// Grab md5 'checksum' of new message
$message_md5 = md5($message_parser->message);