Aleksander Machniak
2015-08-02 08bb20f261d8c6c6e472dc9620d175b171e220d8
program/steps/mail/func.inc
@@ -1,6 +1,6 @@
<?php
/*
/**
 +-----------------------------------------------------------------------+
 | program/steps/mail/func.inc                                           |
 |                                                                       |
@@ -37,7 +37,7 @@
}
// remove mbox part from _uid
if (($_uid  = rcube_utils::get_input_value('_uid', RCUBE_INPUT_GPC)) && !is_array($_uid) && preg_match('/^\d+-.+/', $_uid)) {
if (($_uid  = rcube_utils::get_input_value('_uid', rcube_utils::INPUT_GPC)) && !is_array($_uid) && preg_match('/^\d+-.+/', $_uid)) {
  list($_uid, $mbox) = explode('-', $_uid, 2);
  if (isset($_GET['_uid']))  $_GET['_uid']  = $_uid;
  if (isset($_POST['_uid'])) $_POST['_uid'] = $_uid;
@@ -64,17 +64,6 @@
    $mbox_name = $RCMAIL->storage->get_folder();
    if (empty($RCMAIL->action)) {
        // initialize searching result if search_filter is used
        if ($_SESSION['search_filter'] && $_SESSION['search_filter'] != 'ALL') {
            $RCMAIL->storage->search($mbox_name, $_SESSION['search_filter'], RCUBE_CHARSET, rcmail_sort_column());
            $search_request             = md5($mbox_name.$_SESSION['search_filter']);
            $_SESSION['search']         = $RCMAIL->storage->get_search_set();
            $_SESSION['search_request'] = $search_request;
            $OUTPUT->set_env('search_request', $search_request);
        }
        $OUTPUT->set_env('search_mods', rcmail_search_mods());
        if (!empty($_SESSION['search_scope']))
@@ -172,12 +161,17 @@
    if (!strlen($mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_GPC, true))) {
        $mbox = strlen($_SESSION['mbox']) ? $_SESSION['mbox'] : 'INBOX';
    }
    if (!($page = intval($_GET['_page']))) {
        $page = $_SESSION['page'] ? $_SESSION['page'] : 1;
    if ($RCMAIL->action == 'list') {
        if (!($page = intval($_GET['_page']))) {
            $page = $_SESSION['page'] ? $_SESSION['page'] : 1;
        }
        $_SESSION['page'] = $page;
    }
    $RCMAIL->storage->set_folder($_SESSION['mbox'] = $mbox);
    $RCMAIL->storage->set_page($_SESSION['page'] = $page);
    $RCMAIL->storage->set_page($_SESSION['page']);
    // set default sort col/order to session
    if (!isset($_SESSION['sort_col'])) {
@@ -487,7 +481,7 @@
                $cont = rcube::Q($cont);
            }
            else if ($col == 'size')
                $cont = show_bytes($header->$col);
                $cont = $RCMAIL->show_bytes($header->$col);
            else if ($col == 'date')
                $cont = $RCMAIL->format_date($header->date);
            else if ($col == 'folder') {
@@ -1760,20 +1754,6 @@
}
/**
 * clear message composing settings
 */
function rcmail_compose_cleanup($id)
{
    if (!isset($_SESSION['compose_data_'.$id])) {
        return;
    }
    $rcmail = rcmail::get_instance();
    $rcmail->plugins->exec_hook('attachments_cleanup', array('group' => $id));
    $rcmail->session->remove('compose_data_'.$id);
}
/**
 * Send the MDN response
 *
 * @param mixed $message    Original message object (rcube_message) or UID
@@ -2056,7 +2036,7 @@
    $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('low'), 'HEADER X-PRIORITY 4');
    $select_filter->add($RCMAIL->gettext('priority').': '.$RCMAIL->gettext('lowest'), 'HEADER X-PRIORITY 5');
    $out = $select_filter->show($_SESSION['search_filter']);
    $out = $select_filter->show($_REQUEST['_search'] ? $_SESSION['search_filter'] : 'ALL');
    $RCMAIL->output->add_gui_object('search_filter', $attrib['id']);