From bd0551b22076b82a6d49e9f7a2b2e0c90a1b2326 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Fri, 05 Feb 2016 07:25:27 -0500 Subject: [PATCH] Secure also downloads of addressbook exports, managesieve script exports and Enigma keys exports --- program/lib/Roundcube/rcube_result_index.php | 26 +++++--------------------- 1 files changed, 5 insertions(+), 21 deletions(-) diff --git a/program/lib/Roundcube/rcube_result_index.php b/program/lib/Roundcube/rcube_result_index.php index ffc1ad7..5ea390b 100644 --- a/program/lib/Roundcube/rcube_result_index.php +++ b/program/lib/Roundcube/rcube_result_index.php @@ -1,6 +1,6 @@ <?php -/* +/** +-----------------------------------------------------------------------+ | This file is part of the Roundcube Webmail client | | Copyright (C) 2005-2011, The Roundcube Dev Team | @@ -30,9 +30,9 @@ protected $raw_data; protected $mailbox; - protected $meta = array(); + protected $meta = array(); protected $params = array(); - protected $order = 'ASC'; + protected $order = 'ASC'; const SEPARATOR_ELEMENT = ' '; @@ -40,12 +40,12 @@ /** * Object constructor. */ - public function __construct($mailbox = null, $data = null) + public function __construct($mailbox = null, $data = null, $order = null) { $this->mailbox = $mailbox; + $this->order = $order == 'DESC' ? 'DESC' : 'ASC'; $this->init($data); } - /** * Initializes object with SORT command response @@ -127,7 +127,6 @@ $this->raw_data = $data; } - /** * Checks the result from IMAP command * @@ -138,7 +137,6 @@ return $this->raw_data === null ? true : false; } - /** * Checks if the result is empty * @@ -148,7 +146,6 @@ { return empty($this->raw_data) ? true : false; } - /** * Returns number of elements in the result @@ -171,7 +168,6 @@ return $this->meta['count']; } - /** * Returns number of elements in the result. * Alias for count() for compatibility with rcube_result_thread @@ -182,7 +178,6 @@ { return $this->count(); } - /** * Returns maximal message identifier in the result @@ -198,7 +193,6 @@ return $this->meta['max']; } - /** * Returns minimal message identifier in the result * @@ -213,13 +207,11 @@ return $this->meta['min']; } - /** * Slices data set. * * @param $offset Offset (as for PHP's array_slice()) * @param $length Number of elements (as for PHP's array_slice()) - * */ public function slice($offset, $length) { @@ -230,7 +222,6 @@ $this->meta['count'] = count($data); $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data); } - /** * Filters data set. Removes elements not listed in $ids list. @@ -246,7 +237,6 @@ $this->meta['count'] = count($data); $this->raw_data = implode(self::SEPARATOR_ELEMENT, $data); } - /** * Reverts order of elements in the result @@ -266,7 +256,6 @@ $this->meta['pos'] = array(); } - /** * Check if the given message ID exists in the object @@ -307,7 +296,6 @@ return false; } - /** * Return all messages in the result. * @@ -322,7 +310,6 @@ return explode(self::SEPARATOR_ELEMENT, $this->raw_data); } - /** * Return all messages in the result. * @@ -336,7 +323,6 @@ return rcube_imap_generic::compressMessageSet($this->get()); } - /** * Return result element at specified index @@ -397,7 +383,6 @@ return $data[$index]; } - /** * Returns response parameters, e.g. ESEARCH's MIN/MAX/COUNT/ALL/MODSEQ * or internal data e.g. MAILBOX, ORDER @@ -418,7 +403,6 @@ return $params; } - /** * Returns length of internal data representation -- Gitblit v1.9.1