ソースを参照

Be more liberal regarding (incompliant) POP3 servers who send double
spaces in stead of just one. Thanks Galen Kannarr for the tip.

Thijs Kinkhorst 21 年 前
コミット
778ae78ce1
2 ファイル変更6 行追加5 行削除
  1. 1 0
      ChangeLog
  2. 5 5
      plugins/mail_fetch/class.POP3.php

+ 1 - 0
ChangeLog

@@ -53,6 +53,7 @@ Version 1.5.1 -- CVS
   - Added address book sorting options. Ascending/descending sorting code 
   - Added address book sorting options. Ascending/descending sorting code 
     written by Bryan Loniewski.
     written by Bryan Loniewski.
   - Use Special Folder Color config option works again (#931956).
   - Use Special Folder Color config option works again (#931956).
+  - In POP3-class, be more liberal regarding RFC-incompliant POP3-servers.
 
 
 Version 1.5.0
 Version 1.5.0
 --------------------
 --------------------

+ 5 - 5
plugins/mail_fetch/class.POP3.php

@@ -306,7 +306,7 @@ class POP3 {
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Error ") . "[$reply]";
                 return false;
                 return false;
             }
             }
-            list($junk,$num,$size) = explode(" ",$reply);
+            list($junk,$num,$size) = preg_split('/\s+/',$reply);
             return $size;
             return $size;
         }
         }
         $cmd = "LIST";
         $cmd = "LIST";
@@ -329,7 +329,7 @@ class POP3 {
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
                 $this->ERROR = _("POP3 pop_list:") . ' ' . _("Premature end of list");
                 return false;
                 return false;
             }
             }
-            list($thisMsg,$msgSize) = explode(" ",$line);
+            list($thisMsg,$msgSize) = preg_split('/\s+/',$line);
             settype($thisMsg,"integer");
             settype($thisMsg,"integer");
             if($thisMsg != $msgC)
             if($thisMsg != $msgC)
             {
             {
@@ -399,7 +399,7 @@ class POP3 {
             return $last;
             return $last;
         }
         }
 
 
-        $Vars = explode(" ",$reply);
+        $Vars = preg_split('/\s+/',$reply);
         $count = $Vars[1];
         $count = $Vars[1];
         $size = $Vars[2];
         $size = $Vars[2];
         settype($count,"integer");
         settype($count,"integer");
@@ -530,7 +530,7 @@ class POP3 {
                 $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
                 $this->ERROR = _("POP3 uidl:") . ' ' . _("Error ") . "[$reply]";
                 return false;
                 return false;
             }
             }
-            list ($ok,$num,$myUidl) = explode(" ",$reply);
+            list ($ok,$num,$myUidl) = preg_split('/\s+/',$reply);
             return $myUidl;
             return $myUidl;
         } else {
         } else {
             $this->update_timer();
             $this->update_timer();
@@ -561,7 +561,7 @@ class POP3 {
                 if(ereg("^\.\r\n",$line)) {
                 if(ereg("^\.\r\n",$line)) {
                     break;
                     break;
                 }
                 }
-                list ($msg,$msgUidl) = explode(" ",$line);
+                list ($msg,$msgUidl) = preg_split('/\s+/',$line);
                 $msgUidl = $this->strip_clf($msgUidl);
                 $msgUidl = $this->strip_clf($msgUidl);
                 if($count == $msg) {
                 if($count == $msg) {
                     $UIDLArray[$msg] = $msgUidl;
                     $UIDLArray[$msg] = $msgUidl;