From 87e3ed6ed09a9fcd3cab45a6ce674396e51b95bb Mon Sep 17 00:00:00 2001
From: thomascube <thomas@roundcube.net>
Date: Thu, 10 Aug 2006 14:53:07 -0400
Subject: [PATCH] Updated Slovak translation

---
 program/lib/imap.inc |   35 +++++++++++++++++++++++------------
 1 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index 6067d81..2c07f34 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -43,6 +43,9 @@
 		- Removed <br> from error messages (better for logging)
 		- Added patch to iil_C_Sort() enabling UID SORT commands
 		- 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 ...)
 
 ********************************************************/
@@ -613,15 +616,15 @@
 	//$month_a=array("Jan"=>1,"Feb"=>2,"Mar"=>3,"Apr"=>4,"May"=>5,"Jun"=>6,"Jul"=>7,"Aug"=>8,"Sep"=>9,"Oct"=>10,"Nov"=>11,"Dec"=>12);
 	$month_str=$a[1];
 	$month=$IMAP_MONTHS[$month_str];
-	$day=$a[0];
-	$year=$a[2];
+	$day=(int)$a[0];
+	$year=(int)$a[2];
 	$time=$a[3];
 	$tz_str = $a[4];
 	$tz = substr($tz_str, 0, 3);
-	$ta=explode(":",$time);
+	$ta = explode(":",$time);
 	$hour=(int)$ta[0]-(int)$tz;
-	$minute=$ta[1];
-	$second=$ta[2];
+	$minute=(int)$ta[1];
+	$second=(int)$ta[2];
 	
 	//make UNIX timestamp
 	$time2 = mktime($hour, $minute, $second, $month, $day, $year);
@@ -674,7 +677,9 @@
 	if (empty($index_field)) $index_field="DATE";
 	$index_field = strtoupper($index_field);
 	
-	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;
 	
 	//$fields_a["DATE"] = ($IMAP_USE_INTERNAL_DATE?6:1);
 	$fields_a['DATE'] = 1;
@@ -930,7 +935,9 @@
 	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);
@@ -1011,7 +1018,9 @@
 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();
@@ -1193,8 +1202,10 @@
 	$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";
@@ -1754,7 +1765,7 @@
 		$line=iil_ReadLine($fp, 500);
 		$line=iil_MultLine($fp, $line);
 		$a = explode(" ", $line);
-		if (($line[0]=="*") && ($a[1]=="LSUB")){
+		if (($line[0]=="*") && ($a[1]=="LSUB" || $a[1]=="LIST")){
 			$line = rtrim($line);
             // split one line
 			$a=iil_ExplodeQuotedString(" ", $line);
@@ -2106,4 +2117,4 @@
 	return (iil_C_Expunge($conn, $folder) >= 0);
 }
 
-?>
\ No newline at end of file
+?>

--
Gitblit v1.9.1