X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=f32330b1bd2993b404444390d510c3185124d574;hb=d8415ed878ea9a1a48879622d2ac674e9856d6bd;hp=31cd0a47c74b481bc5ce32a82c59f4498ec01dd1;hpb=f4bb5d22a27e71a16f00bf41238c8a2fdcbf4e3a;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index 31cd0a47..f32330b1 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -1,8 +1,9 @@
rfc822_header;
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$rfc822_header = new Rfc822Header();
$content_type = new ContentType('multipart/report');
@@ -184,9 +190,9 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
$now = getLongDateString( time() );
set_my_charset();
$body = _("Your message") . "\r\n\r\n" .
- "\t" . _("To:") . ' ' . decodeHeader($to,false,false) . "\r\n" .
- "\t" . _("Subject:") . ' ' . decodeHeader($header->subject,false,false) . "\r\n" .
- "\t" . _("Sent:") . ' ' . $senton . "\r\n" .
+ "\t" . _("To") . ': ' . decodeHeader($to,false,false) . "\r\n" .
+ "\t" . _("Subject") . ': ' . decodeHeader($header->subject,false,false) . "\r\n" .
+ "\t" . _("Sent") . ': ' . $senton . "\r\n" .
"\r\n" .
sprintf( _("Was displayed on %s"), $now );
@@ -202,6 +208,8 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
$special_encoding = '7bit';
}
}
+ } elseif (sq_is8bit($body)) {
+ $special_encoding = '8bit';
}
$part1 = new Message();
$part1->setBody($body);
@@ -253,7 +261,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
} else {
require_once(SM_PATH . 'class/deliver/Deliver_SMTP.class.php');
$deliver = new Deliver_SMTP();
- global $smtpServerAddress, $smtpPort, $smtp_auth_mech, $pop_before_smtp;
+ global $smtpServerAddress, $smtpPort, $pop_before_smtp;
$authPop = (isset($pop_before_smtp) && $pop_before_smtp) ? true : false;
get_smtp_user($user, $pass);
$stream = $deliver->initStream($composeMessage,$domain,0,
@@ -265,7 +273,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
$success = $deliver->finalizeStream($stream);
}
if (!$success) {
- $msg = $deliver->dlv_msg . '
' .
+ $msg = $deliver->dlv_msg . '
' .
_("Server replied: ") . $deliver->dlv_ret_nr . ' '.
$deliver->dlv_server_msg;
require_once(SM_PATH . 'functions/display_messages.php');
@@ -302,7 +310,7 @@ function ClearAttachments() {
if ($info['session'] == -1) {
$attached_file = "$hashed_attachment_dir/$info[localfilename]";
if (file_exists($attached_file)) {
- unlink($attached_file);
+ unlink($attached_file);
}
} else {
$rem_attachments[] = $info;
@@ -347,15 +355,15 @@ function formatRecipientString($recipients, $item ) {
foreach($recipients as $r) {
$add = decodeHeader($r->getAddress(true));
if ($string) {
- $string .= '
' . $add;
+ $string .= '
' . $add;
} else {
$string = $add;
if ($cnt > 1) {
- $string .= ' ()';
+ $string .= '">'._("less").')';
} else {
- $string .= '">'._("more").')';
+ $string .= '">'._("more").')';
break;
}
}
@@ -367,11 +375,11 @@ function formatRecipientString($recipients, $item ) {
function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
$color, $FirstTimeSee) {
- global $msn_user_support, $default_use_mdn, $default_use_priority,
+ global $default_use_mdn, $default_use_priority,
$show_xmailer_default, $mdn_user_support, $PHP_SELF, $javascript_on,
- $squirrelmail_language;
+ $squirrelmail_language;
- $mailbox = $aMailbox['NAME'] ;
+ $mailbox = $aMailbox['NAME'];
$header = $message->rfc822_header;
$env = array();
@@ -425,26 +433,26 @@ function formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message,
}
}
- $s = '
';
+ $s = '';
foreach ($env as $key => $val) {
if ($val) {
- $s .= '';
- $s .= html_tag('TD', '' . $key . ': ', 'RIGHT', '', 'VALIGN="TOP" WIDTH="20%"') . "\n";
- $s .= html_tag('TD', $val, 'left', '', 'VALIGN="TOP" WIDTH="80%"') . "\n";
- $s .= '
';
+ $s .= '';
+ $s .= html_tag('td', '' . $key . ': ', 'right', '', 'valign="top" width="20%"') . "\n";
+ $s .= html_tag('td', $val, 'left', '', 'valign="top" width="80%"') . "\n";
+ $s .= '
';
}
}
- echo ''."\n";
- echo ' |
'."\n";
+ echo ''."\n";
+ echo ' | '."\n";
echo $s;
do_hook('read_body_header');
formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color);
- echo ' | ';
- echo ' |
|
'."\n";
- echo '
';
+ echo '
';
+ echo ' |
'."\n";
+ echo '
';
}
/**
@@ -460,7 +468,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
global $base_uri, $draft_folder, $where, $what, $color, $sort,
$startMessage, $PHP_SELF, $save_as_draft,
$enable_forward_as_attachment, $imapConnection, $lastTargetMailbox,
- $data_dir, $username, $delete_prev_next_display,
+ $username, $delete_prev_next_display,
$compose_new_win, $javascript_on;
//FIXME cleanup argument list, use $aMailbox where possible
@@ -596,7 +604,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
// BEGIN MENU ROW - DELETE/REPLY/FORWARD/MOVE/etc.
- $menu_row = '';
+ $menu_row = '';
$comp_uri = $base_uri.'src/compose.php' .
'?passed_id=' . $passed_id .
'&mailbox=' . $urlMailbox .
@@ -607,17 +615,20 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
$target = '';
$on_click='';
$method='method="post" ';
+ $onsubmit='';
if ($compose_new_win == '1') {
if ( $javascript_on ) {
$on_click=' onclick="comp_in_new_form(\''.$comp_uri.'\', this, this.form)"';
$comp_uri = 'javascript:void(0)';
$method='method="get" ';
+ $onsubmit = 'onsubmit="return false" ';
} else {
$target = 'target="_blank"';
}
}
- $menu_row .= "\n".' ';
@@ -648,10 +659,11 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
if (!(isset($passed_ent_id) && $passed_ent_id)) {
$menu_row .= addHidden('mailbox', $aMailbox['NAME']);
$menu_row .= addHidden('msg[0]', $passed_id);
- $menu_row .= getButton('SUBMIT', 'delete', _("Delete"));
- $menu_row .= '' . _("Bypass Trash");
+ $menu_row .= addHidden('startMessage', $startMessage);
+ $menu_row .= getButton('submit', 'delete', _("Delete"));
+ $menu_row .= '' . _("Bypass Trash");
} else {
- $menu_row .= getButton('SUBMIT', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
+ $menu_row .= getButton('submit', 'delete', _("Delete"), '', FALSE) . "\n"; // delete button is disabled
}
$menu_row .= '';
@@ -676,7 +688,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
}
$menu_row .= ' ';
- $menu_row .= getButton('SUBMIT', 'moveButton',_("Move")) . "\n" . '';
+ $menu_row .= getButton('submit', 'moveButton',_("Move")) . "\n" . '';
}
$menu_row .= ' | ';
@@ -715,9 +727,9 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
$url = $base_uri.'src/view_header.php?'.$query_string;
- $s = "\n" .
- html_tag( 'td', '', 'right', '', 'VALIGN="MIDDLE" WIDTH="20%"' ) . '' . _("Options") . ": \n" .
- html_tag( 'td', '', 'left', '', 'VALIGN="MIDDLE" WIDTH="80%"' ) . '' .
+ $s = "\n" .
+ html_tag( 'td', '', 'right', '', 'valign="middle" width="20%"' ) . '' . _("Options") . ": \n" .
+ html_tag( 'td', '', 'left', '', 'valign="middle" width="80%"' ) . '' .
''._("View Full Header").'';
/* Output the printer friendly link if we are in subtle mode. */
@@ -725,8 +737,8 @@ function formatToolbar($mailbox, $passed_id, $passed_ent_id, $message, $color) {
printer_friendly_link($mailbox, $passed_id, $passed_ent_id);
echo $s;
do_hook("read_body_header_right");
- $s = "\n" .
- " \n";
+ $s = "\n" .
+ " \n";
echo $s;
}
@@ -849,7 +861,7 @@ $header = $message->header;
if (isset($sendreceipt)) {
if ( !$message->is_mdnsent ) {
$final_recipient = '';
- if ((isset($identity)) && ($identity != 0)) //Main identity
+ if ((isset($identity)) && ($identity != 0)) //Main identity
$final_recipient = trim(getPref($data_dir, $username, 'email_address' . $identity, '' ));
if ($final_recipient == '' )
$final_recipient = trim(getPref($data_dir, $username, 'email_address', '' ));
@@ -879,7 +891,7 @@ $cnt = count($ent_ar);
for ($i = 0; $i < $cnt; $i++) {
$messagebody .= formatBody($imapConnection, $message, $color, $wrap_at, $ent_ar[$i], $passed_id, $mailbox);
if ($i != $cnt-1) {
- $messagebody .= ' ';
+ $messagebody .= ' ';
}
}
@@ -894,7 +906,7 @@ echo ' ';
// echo ' ';
echo html_tag( 'table' ,'' , 'left', '', 'cellpadding="1" cellspacing="5" border="0"' );
-echo ' ' . html_tag( 'td', ' '. $messagebody."\n", 'left')
+echo ' ' . html_tag( 'td', ' '. $messagebody."\n", 'left')
. ' ';
echo ' ';
echo ' | ';
@@ -902,8 +914,8 @@ echo '
|
';
echo ' ';
echo ' ';
-echo ' |
'."\n";
+echo ' |
'."\n";
$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
if ($attachmentsdisplay) {
@@ -920,8 +932,8 @@ if ($attachmentsdisplay) {
echo ' ';
echo ' ';
echo ' ';
- echo ' |
';
+ echo ' |
';
}
echo '';
@@ -938,10 +950,10 @@ if (($attachment_common_show_images) &&
echo html_tag( 'table', "\n" .
html_tag( 'tr', "\n" .
- html_tag( 'td', '' ."\n", 'left'
+ html_tag( 'td', '' ."\n", 'left'
)
) ,
- 'center', '', 'cellspacing=0 border="0" cellpadding="2"');
+ 'center', '', 'cellspacing="0" border="0" cellpadding="2"');
}
}
@@ -955,5 +967,4 @@ sqimap_logout($imapConnection);
$mailbox_cache[$aMailbox['NAME']] = $aMailbox;
sqsession_register($mailbox_cache,'mailbox_cache');
?>
-