From c2b197ac67be91486f2040666797633bb0e8a230 Mon Sep 17 00:00:00 2001
From: till <till@php.net>
Date: Sat, 02 Feb 2008 08:48:56 -0500
Subject: [PATCH] * replaced more " with ' * some CS * added some comments to delimiter 'logic'

---
 program/lib/imap.inc |   20 +++++++++++++++-----
 1 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/program/lib/imap.inc b/program/lib/imap.inc
index e21bfd5..e4a3306 100644
--- a/program/lib/imap.inc
+++ b/program/lib/imap.inc
@@ -1985,6 +1985,16 @@
     return $r;
 }
 
+/**
+ * Gets the delimiter, for example:
+ * INBOX.foo -> .
+ * INBOX/foo -> /
+ * INBOX\foo -> \
+ * 
+ * @return mixed A delimiter (string), or false. 
+ * @param object $conn The current connection.
+ * @see iil_Connect()
+ */
 function iil_C_GetHierarchyDelimiter(&$conn) {
 	if ($conn->delimiter) {
         return $conn->delimiter;
@@ -1994,16 +2004,16 @@
 	$delimiter = false;
 	
 	//try (LIST "" ""), should return delimiter (RFC2060 Sec 6.3.8)
-	if (!fputs($fp, "ghd LIST \"\" \"\"\r\n")) {
+	if (!fputs($fp, 'ghd LIST "" ""' . "\r\n")) {
 	    return false;
     }
     
 	do {
 		$line=iil_ReadLine($fp, 500);
-		if ($line[0]=="*") {
+		if ($line[0] == '*') {
 			$line = rtrim($line);
 			$a=iil_ExplodeQuotedString(' ', $line);
-			if ($a[0]=="*") {
+			if ($a[0] == '*') {
 			    $delimiter = str_replace('"', '', $a[count($a)-2]);
             }
 		}
@@ -2018,11 +2028,11 @@
 	fputs($conn->fp, "ns1 NAMESPACE\r\n");
 	do {
 		$line = iil_ReadLine($conn->fp, 1024);
-		if (iil_StartsWith($line, "* NAMESPACE")) {
+		if (iil_StartsWith($line, '* NAMESPACE')) {
 			$i = 0;
 			$data = iil_ParseNamespace2(substr($line,11), $i, 0, 0);
 		}
-	} while (!iil_StartsWith($line, "ns1"));
+	} while (!iil_StartsWith($line, 'ns1'));
 		
 	if (!is_array($data)) {
 	    return false;

--
Gitblit v1.9.1