summaryrefslogtreecommitdiff
path: root/program/lib/imap.inc
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2006-07-25 22:11:50 +0000
committerthomascube <thomas@roundcube.net>2006-07-25 22:11:50 +0000
commit24053e0d308d6c80149b812cda8774ed3d6ed71d (patch)
tree9dbd832a2e57bbd4083e6d7ebb62b7bb74bed07d /program/lib/imap.inc
parentf0f98fb108885aca3c29f759128040ef9e015e68 (diff)
Several bugfixes and improvements. See CHANGELOG for details
Diffstat (limited to 'program/lib/imap.inc')
-rw-r--r--program/lib/imap.inc19
1 files changed, 14 insertions, 5 deletions
diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 5251f8414..2c07f3409 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -45,6 +45,7 @@
- Added function iil_C_ID2UID()
- Casting date parts in iil_StrToTime() to avoid mktime() warnings
- Also acceppt LIST responses in iil_C_ListSubscribed()
+ - Sanity check of $message_set in iil_C_FetchHeaders(), iil_C_FetchHeaderIndex(), iil_C_FetchThreadHeaders()
- Removed some debuggers (echo ...)
********************************************************/
@@ -676,7 +677,9 @@ function iil_C_FetchHeaderIndex(&$conn, $mailbox, $message_set, $index_field, $n
if (empty($index_field)) $index_field="DATE";
$index_field = strtoupper($index_field);
- if ((empty($message_set)) || ($message_set == "1:0")) return array();
+ list($from_idx, $to_idx) = explode(':', $message_set);
+ if (empty($message_set) || (isset($to_idx) && (int)$from_idx > (int)$to_idx))
+ return false;
//$fields_a["DATE"] = ($IMAP_USE_INTERNAL_DATE?6:1);
$fields_a['DATE'] = 1;
@@ -932,7 +935,9 @@ function iil_C_FetchThreadHeaders(&$conn, $mailbox, $message_set){
global $clock;
global $index_a;
- if (empty($message_set)) return false;
+ list($from_idx, $to_idx) = explode(':', $message_set);
+ if (empty($message_set) || (isset($to_idx) && (int)$from_idx > (int)$to_idx))
+ return false;
$result = array();
$uids = iil_C_FetchUIDs($conn, $mailbox);
@@ -1013,7 +1018,9 @@ function iil_C_FetchThreadHeaders(&$conn, $mailbox, $message_set){
function iil_C_BuildThreads2(&$conn, $mailbox, $message_set, &$clock){
global $index_a;
- if (empty($message_set)) return false;
+ list($from_idx, $to_idx) = explode(':', $message_set);
+ if (empty($message_set) || (isset($to_idx) && (int)$from_idx > (int)$to_idx))
+ return false;
$result=array();
$roots=array();
@@ -1195,8 +1202,10 @@ function iil_C_FetchHeaders(&$conn, $mailbox, $message_set){
$result=array();
$fp = $conn->fp;
- if (empty($message_set)) return array();
-
+ list($from_idx, $to_idx) = explode(':', $message_set);
+ if (empty($message_set) || (isset($to_idx) && (int)$from_idx > (int)$to_idx))
+ return false;
+
/* Do "SELECT" command */
if (!iil_C_Select($conn, $mailbox)){
$conn->error = "Couldn't select $mailbox";