Be more liberal regarding (incompliant) POP3 servers who send double
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 May 2004 19:47:40 +0000 (19:47 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Sat, 8 May 2004 19:47:40 +0000 (19:47 +0000)
spaces in stead of just one. Thanks Galen Kannarr for the tip.

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@7404 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
plugins/mail_fetch/class.POP3.php

index 33f88bf..4f835b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -53,6 +53,7 @@ Version 1.5.1 -- CVS
   - Added address book sorting options. Ascending/descending sorting code 
     written by Bryan Loniewski.
   - Use Special Folder Color config option works again (#931956).
+  - In POP3-class, be more liberal regarding RFC-incompliant POP3-servers.
 
 Version 1.5.0
 --------------------
index 8b68493..046bb77 100644 (file)
@@ -306,7 +306,7 @@ class POP3 {
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
                 return false;
             }
-            list($junk,$num,$size) = explode(" ",$reply);
+            list($junk,$num,$size) = preg_split('/\s+/',$reply);
             return $size;
         }
         $cmd = "LIST";
@@ -329,7 +329,7 @@ class POP3 {
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
                 return false;
             }
-            list($thisMsg,$msgSize) = explode(" ",$line);
+            list($thisMsg,$msgSize) = preg_split('/\s+/',$line);
             settype($thisMsg,"integer");
             if($thisMsg != $msgC)
             {
@@ -399,7 +399,7 @@ class POP3 {
             return $last;
         }
 
-        $Vars = explode(" ",$reply);
+        $Vars = preg_split('/\s+/',$reply);
         $count = $Vars[1];
         $size = $Vars[2];
         settype($count,"integer");
@@ -530,7 +530,7 @@ class POP3 {
                 $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
                 return false;
             }
-            list ($ok,$num,$myUidl) = explode(" ",$reply);
+            list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply);
             return $myUidl;
         } else {
             $this->update_timer();
@@ -561,7 +561,7 @@ class POP3 {
                 if(ereg("^\.\r\n",$line)) {
                     break;
                 }
-                list ($msg,$msgUidl) = explode(" ",$line);
+                list ($msg,$msgUidl) = preg_split('/\s+/',$line);
                 $msgUidl = $this->strip_clf($msgUidl);
                 if($count == $msg) {
                     $UIDLArray[$msg] = $msgUidl;