aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php33
-rw-r--r--phpBB/includes/ucp/ucp_pm_viewmessage.php10
2 files changed, 25 insertions, 18 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 8fa5de090f..0dd85c06ae 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -48,7 +48,7 @@ function compose_pm($id, $mode, $action)
$add_to = (isset($_REQUEST['add_to'])) ? true : false;
$add_bcc = (isset($_REQUEST['add_bcc'])) ? true : false;
- $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || $save || $load
+ $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load
|| $remove_u || $remove_g || $add_to || $add_bcc;
$action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action;
@@ -514,14 +514,17 @@ function compose_pm($id, $mode, $action)
}
// Subject defined
- if (!$subject && !($remove_u || $remove_g || $add_to || $add_bcc))
+ if ($submit)
{
- $error[] = $user->lang['EMPTY_SUBJECT'];
- }
+ if (!$subject)
+ {
+ $error[] = $user->lang['EMPTY_SUBJECT'];
+ }
- if (!sizeof($address_list))
- {
- $error[] = $user->lang['NO_RECIPIENT'];
+ if (!sizeof($address_list))
+ {
+ $error[] = $user->lang['NO_RECIPIENT'];
+ }
}
if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc))
@@ -597,10 +600,20 @@ function compose_pm($id, $mode, $action)
// Attachment Preview
if (sizeof($message_parser->attachment_data))
{
- $extensions = $update_count = array();
-
$template->assign_var('S_HAS_ATTACHMENTS', true);
- display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count);
+
+ $update_count = array();
+ $attachment_data = $message_parser->attachment_data;
+
+ parse_attachments(0, $preview_message, $attachment_data, $update_count, true);
+
+ foreach ($attachment_data as $i => $attachment)
+ {
+ $template->assign_block_vars('attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ unset($attachment_data);
}
$preview_subject = censor_text($subject);
diff --git a/phpBB/includes/ucp/ucp_pm_viewmessage.php b/phpBB/includes/ucp/ucp_pm_viewmessage.php
index 2ddd5766d4..d87acfee69 100644
--- a/phpBB/includes/ucp/ucp_pm_viewmessage.php
+++ b/phpBB/includes/ucp/ucp_pm_viewmessage.php
@@ -117,16 +117,10 @@ function view_message($id, $mode, $folder_id, $msg_id, $folder, $message_row)
}
// Assign inline attachments
- if (isset($attachments) && sizeof($attachments))
+ if (!empty($attachments))
{
$update_count = array();
- $unset_attachments = parse_inline_attachments($message, $attachments, $update_count, 0);
-
- // Needed to let not display the inlined attachments at the end of the message again
- foreach ($unset_attachments as $index)
- {
- unset($attachments[$index]);
- }
+ parse_attachments(0, $message, $attachments, $update_count);
// Update the attachment download counts
if (sizeof($update_count))