Aleksander Machniak
2015-12-18 3b36bcfb68476c83cecfdb6e765c014bbdbd5134
program/steps/mail/func.inc
@@ -2268,8 +2268,6 @@
    if ($attachment['status']) {
        unset($attachment['data'], $attachment['status'], $attachment['content_id'], $attachment['abort']);
        $session_key = 'compose_data_' . $compose_id;
        // rcube_session::append() replaces current session data with the old values
        // (in rcube_session::reload()). This is a problem in 'compose' action, because before
        // the first append() use we set some important data in the session.
@@ -2278,14 +2276,11 @@
        // So, for now we'll do not use append() on 'compose' action (#1490608).
        if ($rcmail->action == 'compose') {
            $_SESSION[$session_key]['attachments'][$attachment['id']] = $attachment;
            $COMPOSE['attachments'][$attachment['id']] = $attachment;
        }
        else {
            $rcmail->session->append($session_key . '.attachments', $attachment['id'], $attachment);
            $rcmail->session->append('compose_data_' . $compose_id . '.attachments', $attachment['id'], $attachment);
        }
        // Fix reference to compose session data after rcube_session::append()
        $COMPOSE =& $_SESSION[$session_key];
        return $attachment;
    }