aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes')
-rw-r--r--phpBB/includes/message_parser.php17
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php17
2 files changed, 4 insertions, 30 deletions
diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php
index be753dd5ea..3df582d640 100644
--- a/phpBB/includes/message_parser.php
+++ b/phpBB/includes/message_parser.php
@@ -1345,7 +1345,7 @@ class parse_message extends bbcode_firstpass
/**
* Parse Attachments
*/
- function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false, $post_msg_id = 0, $topic_id = 0)
+ function parse_attachments($form_name, $mode, $forum_id, $submit, $preview, $refresh, $is_message = false)
{
global $config, $auth, $user, $phpbb_root_path, $phpEx, $db;
@@ -1498,27 +1498,16 @@ class parse_message extends bbcode_firstpass
'filesize' => $filedata['filesize'],
'filetime' => $filedata['filetime'],
'thumbnail' => $filedata['thumbnail'],
- 'is_orphan' => ($post_msg_id) ? 0 : 1,
+ 'is_orphan' => 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;
- }
- set_config_count('upload_dir_size', $filedata['filesize'], true);
- set_config_count('num_files', 1, true);
- }
-
$db->sql_query('INSERT INTO ' . ATTACHMENTS_TABLE . ' ' . $db->sql_build_array('INSERT', $sql_ary));
$new_entry = array(
'attach_id' => $db->sql_nextid(),
- 'is_orphan' => ($post_msg_id) ? 0 : 1,
+ 'is_orphan' => 1,
'real_filename' => $filedata['real_filename'],
'attach_comment'=> $this->filename_data['filecomment'],
);
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 1d428ce92e..fba3bfeb32 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -669,22 +669,7 @@ function compose_pm($id, $mode, $action)
}
// Parse Attachments - before checksum is calculated
- if ($action == 'edit')
- {
- $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true, $msg_id);
- if (sizeof($message_parser->attachment_data))
- {
- // Update attachment indicators for pms having attachments now, as a precaution if the pm does not get stored by submit
- $sql = 'UPDATE ' . PRIVMSGS_TABLE . '
- SET message_attachment = 1
- WHERE msg_id = ' . $msg_id;
- $db->sql_query($sql);
- }
- }
- else
- {
- $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
- }
+ $message_parser->parse_attachments('fileupload', $action, 0, $submit, $preview, $refresh, true);
if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc))
{