diff options
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/mail/compose.inc | 16 | ||||
-rw-r--r-- | program/steps/mail/func.inc | 4 | ||||
-rw-r--r-- | program/steps/mail/get.inc | 23 | ||||
-rw-r--r-- | program/steps/mail/sendmail.inc | 1 | ||||
-rw-r--r-- | program/steps/settings/edit_folder.inc | 4 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 4 | ||||
-rw-r--r-- | program/steps/settings/func.inc | 21 | ||||
-rw-r--r-- | program/steps/settings/save_folder.inc | 6 | ||||
-rw-r--r-- | program/steps/utils/error.inc | 1 |
9 files changed, 56 insertions, 24 deletions
diff --git a/program/steps/mail/compose.inc b/program/steps/mail/compose.inc index 646d2bcd1..f75b219ff 100644 --- a/program/steps/mail/compose.inc +++ b/program/steps/mail/compose.inc @@ -110,9 +110,10 @@ $OUTPUT->add_label('nosubject', 'nosenderwarning', 'norecipientwarning', 'nosubj 'nobodywarning', 'notsentwarning', 'notuploadedwarning', 'savingmessage', 'sendingmessage', 'messagesaved', 'converting', 'editorwarning', 'searching', 'uploading', 'uploadingmany', 'fileuploaderror', 'sendmessage', 'savenewresponse', 'responsename', 'responsetext', 'save', - 'savingresponse'); + 'savingresponse', 'restoresavedcomposedata', 'restoremessage', 'delete', 'restore', 'ignore'); $OUTPUT->set_env('compose_id', $COMPOSE['id']); +$OUTPUT->set_env('session_id', session_id()); $OUTPUT->set_pagetitle(rcube_label('compose')); // add config parameters to client script @@ -239,6 +240,9 @@ if (!empty($msg_uid) && empty($COMPOSE['as_attachment'])) $COMPOSE['reply_msgid'] = '<' . $in_reply_to . '>'; $COMPOSE['references'] = $MESSAGE->headers->references; + + // use message-ID as draft_id, same as in sendmail.inc + $OUTPUT->set_env('draft_id', trim($MESSAGE->headers->get('message-id'), '<>')); } } else { @@ -442,6 +446,11 @@ function rcmail_process_compose_params(&$COMPOSE) } } + // clean HTML message body which can be submitted by URL + if ($COMPOSE['param']['body']) { + $COMPOSE['param']['body'] = rcmail_wash_html($COMPOSE['param']['body'], array('safe' => false, 'inline_html' => true), array()); + } + $RCMAIL = rcmail::get_instance(); // select folder where to save the sent message @@ -642,7 +651,7 @@ function rcmail_prepare_message_body() } else if ($COMPOSE['param']['body']) { $body = $COMPOSE['param']['body']; - $isHtml = false; + $isHtml = (bool) $COMPOSE['param']['html']; } // forward as attachment else if ($compose_mode == RCUBE_COMPOSE_FORWARD && $COMPOSE['as_attachment']) { @@ -827,6 +836,9 @@ function rcmail_compose_body($attrib) $msgtype = new html_hiddenfield(array('name' => '_is_html', 'value' => ($isHtml?"1":"0"))); $out .= $msgtype->show(); + $framed = new html_hiddenfield(array('name' => '_framed', 'value' => '1')); + $out .= $framed->show(); + // If desired, set this textarea to be editable by TinyMCE if ($isHtml) { $MESSAGE_BODY = htmlentities($MESSAGE_BODY, ENT_NOQUOTES, RCMAIL_CHARSET); diff --git a/program/steps/mail/func.inc b/program/steps/mail/func.inc index 78a977b82..8164592dd 100644 --- a/program/steps/mail/func.inc +++ b/program/steps/mail/func.inc @@ -1342,9 +1342,9 @@ function rcmail_html4inline($body, $container_id, $body_id='', &$attributes=null if (preg_match($regexp, $body, $m)) { $attrs = $m[0]; // Get bgcolor, we'll set it as background-color of the message container - if ($m[1] && preg_match('/bgcolor=["\']*([a-z0-9#]+)["\']*/', $attrs, $mb)) { + if ($m[1] && preg_match('/bgcolor=["\']*([a-z0-9#]+)["\']*/i', $attrs, $mb)) { $attributes['background-color'] = $mb[1]; - $attrs = preg_replace('/bgcolor=["\']*([a-z0-9#]+)["\']*/', '', $attrs); + $attrs = preg_replace('/bgcolor=["\']*[a-z0-9#]+["\']*/i', '', $attrs); } // Get background, we'll set it as background-image of the message container if ($m[1] && preg_match('/background=["\']*([^"\'>\s]+)["\']*/', $attrs, $mb)) { diff --git a/program/steps/mail/get.inc b/program/steps/mail/get.inc index e0c4e2911..ae48307e3 100644 --- a/program/steps/mail/get.inc +++ b/program/steps/mail/get.inc @@ -84,17 +84,18 @@ else if ($_GET['_thumb']) { // render thumbnail image if not done yet if (!is_file($cache_file)) { - $fp = fopen(($orig_name = $cache_basename . '.orig.' . $ext), 'w'); - $MESSAGE->get_part_content($part->mime_id, $fp); - fclose($fp); - - $image = new rcube_image($orig_name); - if ($imgtype = $image->resize($thumbnail_size, $cache_file, true)) { - $mimetype = 'image/' . $imgtype; - unlink($orig_name); - } - else { - rename($orig_name, $cache_file); + if ($fp = fopen(($orig_name = $cache_basename . '.orig.' . $ext), 'w')) { + $MESSAGE->get_part_content($part->mime_id, $fp); + fclose($fp); + + $image = new rcube_image($orig_name); + if ($imgtype = $image->resize($thumbnail_size, $cache_file, true)) { + $mimetype = 'image/' . $imgtype; + unlink($orig_name); + } + else { + rename($orig_name, $cache_file); + } } } diff --git a/program/steps/mail/sendmail.inc b/program/steps/mail/sendmail.inc index 52b02ecff..ea5eaaed1 100644 --- a/program/steps/mail/sendmail.inc +++ b/program/steps/mail/sendmail.inc @@ -855,6 +855,7 @@ else { $folders[] = $COMPOSE['mailbox']; rcmail_compose_cleanup($COMPOSE_ID); + $OUTPUT->command('remove_compose_data', $COMPOSE_ID); if ($store_folder && !$saved) $OUTPUT->command('sent_successfully', 'error', rcube_label('errorsavingsent'), $folders); diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index f19e2177b..7f2a10ebc 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -28,11 +28,11 @@ function rcmail_folder_form($attrib) $storage = $RCMAIL->get_storage(); // edited folder name (empty in create-folder mode) - $mbox = trim(get_input_value('_mbox', RCUBE_INPUT_GPC, true)); + $mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true); $mbox_imap = rcube_charset_convert($mbox, RCMAIL_CHARSET, 'UTF7-IMAP'); // predefined path for new folder - $parent = trim(get_input_value('_path', RCUBE_INPUT_GPC, true)); + $parent = get_input_value('_path', RCUBE_INPUT_GPC, true); $parent_imap = rcube_charset_convert($parent, RCMAIL_CHARSET, 'UTF7-IMAP'); $threading_supported = $storage->get_capability('THREAD'); diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 64af18d62..44482e938 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -109,7 +109,7 @@ else if ($RCMAIL->action == 'delete-folder') else if ($RCMAIL->action == 'rename-folder') { $name_utf8 = trim(get_input_value('_folder_newname', RCUBE_INPUT_POST, true)); - $oldname_utf8 = trim(get_input_value('_folder_oldname', RCUBE_INPUT_POST, true)); + $oldname_utf8 = get_input_value('_folder_oldname', RCUBE_INPUT_POST, true); if (strlen($name_utf8) && strlen($oldname_utf8)) { $name = rcube_charset_convert($name_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); @@ -167,7 +167,7 @@ else if ($RCMAIL->action == 'purge') // get mailbox size else if ($RCMAIL->action == 'folder-size') { - $name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true)); + $name = get_input_value('_mbox', RCUBE_INPUT_POST, true); $size = $STORAGE->folder_size($name); diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc index c922aca08..81744d904 100644 --- a/program/steps/settings/func.inc +++ b/program/steps/settings/func.inc @@ -1180,12 +1180,29 @@ function rcmail_user_prefs($current = null) $data = $RCMAIL->plugins->exec_hook('preferences_list', array('section' => $sect['id'], 'blocks' => $blocks, 'current' => $current)); + $advanced_prefs = $config['advanced_prefs']; + // create output - foreach ($data['blocks'] as $block) { + foreach ($data['blocks'] as $key => $block) { if (!empty($block['content']) || !empty($block['options'])) { $found = true; - break; } + // move some options to the 'advanced' block as configured by admin + if ($key != 'advanced') { + foreach ($advanced_prefs as $opt) { + if ($block['options'][$opt]) { + $data['blocks']['advanced']['options'][$opt] = $block['options'][$opt]; + unset($data['blocks'][$key]['options'][$opt]); + } + } + } + } + + // move 'advanced' block to the end of the list + if (!empty($data['blocks']['advanced'])) { + $adv = $data['blocks']['advanced']; + unset($data['blocks']['advanced']); + $data['blocks']['advanced'] = $adv; } if (!$found) diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc index 877b0fbbe..efb096d57 100644 --- a/program/steps/settings/save_folder.inc +++ b/program/steps/settings/save_folder.inc @@ -5,7 +5,7 @@ | program/steps/settings/save_folder.inc | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2012, The Roundcube Dev Team | + | Copyright (C) 2005-2013, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -26,8 +26,8 @@ $STORAGE = $RCMAIL->get_storage(); $name = trim(get_input_value('_name', RCUBE_INPUT_POST, true)); -$old = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true)); -$path = trim(get_input_value('_parent', RCUBE_INPUT_POST, true)); +$old = get_input_value('_mbox', RCUBE_INPUT_POST, true); +$path = get_input_value('_parent', RCUBE_INPUT_POST, true); $name_imap = rcube_charset_convert($name, RCMAIL_CHARSET, 'UTF7-IMAP'); $old_imap = rcube_charset_convert($old, RCMAIL_CHARSET, 'UTF7-IMAP'); diff --git a/program/steps/utils/error.inc b/program/steps/utils/error.inc index 9fb71c528..a891d42f8 100644 --- a/program/steps/utils/error.inc +++ b/program/steps/utils/error.inc @@ -110,6 +110,7 @@ EOF; if ($rcmail->output && $rcmail->output->template_exists('error')) { $rcmail->output->reset(); + $rcmail->output->set_env('server_error', $ERROR_CODE); $rcmail->output->send('error'); } |