X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fcompose.php;h=ed6c0e6a1f8d11281027a1eeddd165b9553fb54e;hp=cbde37838c6e033a72a64846f3d206f062ac25b3;hb=61bd57f55a8f10c323506bb2b6288c806aed260b;hpb=f8eb968dc660db0d25af1f79cb59bb1a44ab28eb
diff --git a/src/compose.php b/src/compose.php
index cbde3783..ed6c0e6a 100644
--- a/src/compose.php
+++ b/src/compose.php
@@ -60,7 +60,9 @@ sqsession_unregister('compose_messages');
$oErrorHandler->setDelayedErrors(true);
/** SESSION/POST/GET VARS */
-sqgetGlobalVar('send', $send, SQ_POST);
+sqgetGlobalVar('send_button_count', $send_button_count, SQ_POST, 1, SQ_TYPE_INT);
+for ($i = 1; $i <= $send_button_count; $i++)
+ if (sqgetGlobalVar('send' . $i, $send, SQ_POST)) break;
// Send can only be achieved by setting $_POST var. If Send = true then
// retrieve other form fields from $_POST
if (isset($send) && $send) {
@@ -154,7 +156,7 @@ if ( sqgetGlobalVar('mailtodata', $mailtodata, SQ_GET) ) {
unset($mailtodata,$mtdata, $trtable);
}
-/* Location (For HTTP 1.1 Header("Location: ...") redirects) */
+/* Location (For HTTP 1.1 header("Location: ...") redirects) */
$location = get_location();
/* Identities (fetch only once) */
$idents = get_identities();
@@ -237,9 +239,7 @@ function getReplyCitation($orig_from, $orig_date) {
/* Otherwise, try to select the desired citation style. */
switch ($reply_citation_style) {
case 'author_said':
- /**
- * To translators: %s is for author's name
- */
+ // i18n: %s is for author's name
$full_reply_citation = sprintf(_("%s wrote:"),$sOrig_from);
break;
case 'quote_who':
@@ -248,15 +248,14 @@ function getReplyCitation($orig_from, $orig_date) {
$full_reply_citation = $start . $sOrig_from . $end;
break;
case 'date_time_author':
- /**
- * To translators:
- * first %s is for date string, second %s is for author's name. Date uses
- * formating from "D, F j, Y g:i a" and "D, F j, Y H:i" translations.
- * Example string:
- * "On Sat, December 24, 2004 23:59, Santa wrote:"
- * If you have to put author's name in front of date string, check comments about
- * argument swapping at http://www.php.net/sprintf
- */
+ // i18n:
+ // The first %s is for date string, the second %s is for author's name.
+ // The date uses formating from "D, F j, Y g:i a" and "D, F j, Y H:i"
+ // translations.
+ // Example string:
+ // "On Sat, December 24, 2004 23:59, Santa wrote:"
+ // If you have to put author's name in front of date string, check comments about
+ // argument swapping at http://php.net/sprintf
$full_reply_citation = sprintf(_("On %s, %s wrote:"), getLongDateString($orig_date), $sOrig_from);
break;
case 'user-defined':
@@ -329,11 +328,8 @@ if (sqsession_is_registered('session_expired_post')) {
* extra check for username so we don't display previous post data from
* another user during this session.
*/
- if ($session_expired_post['username'] != $username) {
- unset($session_expired_post);
- sqsession_unregister('session_expired_post');
- session_write_close();
- } else {
+ if (!empty($session_expired_post['username'])
+ && $session_expired_post['username'] == $username) {
// these are the vars that we can set from the expired composed session
$compo_var_list = array ('send_to', 'send_to_cc', 'body',
'startMessage', 'passed_body', 'use_signature', 'signature',
@@ -349,7 +345,7 @@ if (sqsession_is_registered('session_expired_post')) {
}
if (!empty($attachments))
- $attachments = unserialize($attachments);
+ $attachments = unserialize(urldecode($attachments));
sqsession_register($composesession,'composesession');
@@ -369,11 +365,11 @@ if (sqsession_is_registered('session_expired_post')) {
} else {
$sHeaderJs = (isset($sHeaderJs)) ? $sHeaderJs : '';
if (strpos($action, 'reply') !== false && $reply_focus) {
- $sBodyTagJs = 'onload="checkForm(\''.$replyfocus.'\');"';
+ $sOnload = 'checkForm(\''.$replyfocus.'\');';
} else {
- $sBodyTagJs = 'onload="checkForm();"';
+ $sOnload = 'checkForm();';
}
- displayPageHeader($color, $mailbox,$sHeaderJs,$sBodyTagJs);
+ displayPageHeader($color, $mailbox,$sHeaderJs,$sOnload);
}
showInputForm($session, false);
exit();
@@ -392,25 +388,20 @@ if (!isset($session) || (isset($newmessage) && $newmessage)) {
$composesession = $session;
sqsession_register($composesession,'composesession');
}
-if (!isset($compose_messages)) {
- $compose_messages = array();
-}
-
-if (!isset($compose_messages[$session]) || ($compose_messages[$session] == NULL)) {
+if (!empty($compose_messages[$session])) {
+ $composeMessage = $compose_messages[$session];
+} else {
$composeMessage = new Message();
$rfc822_header = new Rfc822Header();
$composeMessage->rfc822_header = $rfc822_header;
$composeMessage->reply_rfc822_header = '';
- $compose_messages[$session] = $composeMessage;
-} else {
- $composeMessage=$compose_messages[$session];
}
// re-add attachments that were already in this message
// FIXME: note that technically this is very bad form -
// should never directly manipulate an object like this
if (!empty($attachments)) {
- $attachments = unserialize($attachments);
+ $attachments = unserialize(urldecode($attachments));
if (!empty($attachments) && is_array($attachments))
$composeMessage->entities = $attachments;
}
@@ -425,7 +416,6 @@ if ($draft) {
* of language interface.
*/
set_my_charset();
- $composeMessage = $compose_messages[$session];
if (! deliverMessage($composeMessage, true)) {
showInputForm($session);
exit();
@@ -450,7 +440,7 @@ if ($draft) {
if ($compose_new_win == '1') {
if ( !isset($pageheader_sent) || !$pageheader_sent ) {
- Header("Location: $location/compose.php?saved_draft=yes&session=$composesession");
+ header("Location: $location/compose.php?saved_draft=yes&session=$composesession");
} else {
//FIXME: DON'T ECHO HTML FROM CORE!
echo '