X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fread_body.php;h=09c41347ee2a2b9e322615fe859f63a7295902b3;hb=f7cd8eb4e788b45f94c494836eae2ac63522a672;hp=e07ab9db62189953a5d8505d2de76ce365a8c7e9;hpb=e1728a7ada03ba597fc2f8a800773cb427a711ce;p=squirrelmail.git
diff --git a/src/read_body.php b/src/read_body.php
index e07ab9db..09c41347 100644
--- a/src/read_body.php
+++ b/src/read_body.php
@@ -1,13 +1,13 @@
$value) {
- if ($passed_id == $value) {
- if ($key == $count) {
- break;
- }
- $result = $uidset[$key + 1];
- break;
- }
+ $result = sqm_array_get_value_by_offset($uidset,$passed_id,1);
+ if ($result === false) {
+ return -1;
+ } else {
+ return $result;
}
- return $result;
}
/**
@@ -70,17 +65,12 @@ function findPreviousMessage($uidset, $passed_id) {
if (!is_array($uidset)) {
return -1;
}
- $result = -1;
- foreach($uidset as $key=>$value) {
- if ($passed_id == $value) {
- if ($key != 0) {
- $result = $uidset[$key - 1];
- }
- break;
- }
+ $result = sqm_array_get_value_by_offset($uidset,$passed_id,-1);
+ if ($result === false) {
+ return -1;
+ } else {
+ return $result;
}
-
- return $result;
}
/**
@@ -90,11 +80,19 @@ function findPreviousMessage($uidset, $passed_id) {
* @param int $passed_id
*/
function printer_friendly_link($mailbox, $passed_id, $passed_ent_id) {
- global $javascript_on, $color;
+ global $javascript_on, $show_html_default;
+ /* hackydiehack */
+ if( !sqgetGlobalVar('view_unsafe_images', $view_unsafe_images, SQ_GET) ) {
+ $view_unsafe_images = false;
+ } else {
+ $view_unsafe_images = true;
+ }
$params = '?passed_ent_id=' . urlencode($passed_ent_id) .
'&mailbox=' . urlencode($mailbox) .
- '&passed_id=' . urlencode($passed_id);
+ '&passed_id=' . urlencode($passed_id) .
+ '&view_unsafe_images='. (bool) $view_unsafe_images .
+ '&show_html_default=' . $show_html_default;
$print_text = _("View Printable Version");
@@ -124,15 +122,13 @@ function ServerMDNSupport($aFlags) {
}
function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
- global $username, $attachment_dir,
- $version, $attachments, $squirrelmail_language, $default_charset,
- $languages, $useSendmail, $domain, $sent_folder,
- $popuser, $data_dir, $username;
+ global $username, $attachment_dir, $popuser, $username, $color,
+ $version, $squirrelmail_language, $default_charset,
+ $languages, $useSendmail, $domain, $sent_folder;
sqgetGlobalVar('SERVER_NAME', $SERVER_NAME, SQ_SERVER);
$header = $message->rfc822_header;
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
$rfc822_header = new Rfc822Header();
$content_type = new ContentType('multipart/report');
@@ -202,6 +198,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 +251,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,
@@ -266,7 +264,7 @@ function SendMDN ( $mailbox, $passed_id, $sender, $message, $imapConnection) {
}
if (!$success) {
$msg = $deliver->dlv_msg . '
' .
- _("Server replied: ") . $deliver->dlv_ret_nr . ' '.
+ _("Server replied:") . ' ' . $deliver->dlv_ret_nr . ' ' .
$deliver->dlv_server_msg;
require_once(SM_PATH . 'functions/display_messages.php');
plain_error_message($msg, $color);
@@ -291,27 +289,6 @@ function ToggleMDNflag ($set ,$imapConnection, $mailbox, $passed_id) {
$readmessage, TRUE);
}
-function ClearAttachments() {
- global $username, $attachments, $attachment_dir;
-
- $hashed_attachment_dir = getHashedDir($username, $attachment_dir);
-
- $rem_attachments = array();
- if (isset($attachments)) {
- foreach ($attachments as $info) {
- if ($info['session'] == -1) {
- $attached_file = "$hashed_attachment_dir/$info[localfilename]";
- if (file_exists($attached_file)) {
- unlink($attached_file);
- }
- } else {
- $rem_attachments[] = $info;
- }
- }
- }
- $attachments = $rem_attachments;
-}
-
function formatRecipientString($recipients, $item ) {
global $show_more_cc, $show_more, $show_more_bcc,
$PHP_SELF;
@@ -367,11 +344,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();
@@ -460,8 +437,8 @@ 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,
- $compose_new_win, $javascript_on;
+ $username, $delete_prev_next_display,
+ $compose_new_win, $javascript_on, $compose_width, $compose_height;
//FIXME cleanup argument list, use $aMailbox where possible
$mailbox = $aMailbox['NAME'];
@@ -493,7 +470,7 @@ function formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message, $removed
}
$prev_link = _("Previous");
- if($entities[$passed_ent_id] > 1) {
+ if(isset($entities[$passed_ent_id]) && $entities[$passed_ent_id] > 1) {
$prev_ent_id = $entity_count[$entities[$passed_ent_id] - 1];
$prev_link = '