aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/message_parser.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/includes/message_parser.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/includes/message_parser.php')
-rw-r--r--phpBB/includes/message_parser.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index 7370c2057c..7a2d35dbc6 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1334,7 +1334,7 @@ class parse_message extends bbcode_firstpass
/**
* Parse Attachments
*/
- function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
+ function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false, $post_msg_id = 0, $topic_id = 0)
{
global $config, $auth, $user, $phpbb_root_path, $phpEx, $db;
@@ -1487,16 +1487,25 @@ class parse_message extends bbcode_firstpass
'filesize' => $filedata['filesize'],
'filetime' => $filedata['filetime'],
'thumbnail' => $filedata['thumbnail'],
- 'is_orphan' => 1,
+ 'is_orphan' => ($post_msg_id) ? 0 : 1,
'in_message' => ($is_message) ? 1 : 0,
'poster_id' => $user->data['user_id'],
);
+ if ($post_msg_id)
+ {
+ $sql_ary['post_msg_id'] = $post_msg_id;
+ if ($topic_id)
+ {
+ $sql_ary['topic_id'] = $topic_id;
+ }
+ }
+
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_entry = array(
'attach_id' => $db->sql_nextid(),
- 'is_orphan' => 1,
+ 'is_orphan' => ($post_msg_id) ? 0 : 1,
'real_filename' => $filedata['real_filename'],
'attach_comment'=> $this->filename_data['filecomment'],
);