Sfoglia il codice sorgente

Minor, rare bug fix: Properly reduce multiple spaces in date headers

pdontthink 3 anni fa
parent
commit
1b4ce00bb4
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      functions/imap_messages.php

+ 2 - 2
functions/imap_messages.php

@@ -710,7 +710,7 @@ function parseFetch(&$aResponse,$aMessageList = array()) {
             case 'BODYSTRUCTURE':
             case 'BODYSTRUCTURE':
                 break; // to be implemented, moving imap code out of the Message class
                 break; // to be implemented, moving imap code out of the Message class
             case 'INTERNALDATE':
             case 'INTERNALDATE':
-                $aMsg['INTERNALDATE'] = trim(str_replace('  ', ' ',parseString($read,$i)));
+                $aMsg['INTERNALDATE'] = trim(preg_replace('/\s+/', ' ',parseString($read,$i)));
                 break;
                 break;
             case 'BODY.PEEK[HEADER.FIELDS':
             case 'BODY.PEEK[HEADER.FIELDS':
             case 'BODY[HEADER.FIELDS':
             case 'BODY[HEADER.FIELDS':
@@ -731,7 +731,7 @@ function parseFetch(&$aResponse,$aMessageList = array()) {
                             $value = trim(substr($line, $pos+1));
                             $value = trim(substr($line, $pos+1));
                             switch($field) {
                             switch($field) {
                                 case 'date':
                                 case 'date':
-                                    $aMsg['date'] = trim(str_replace('  ', ' ', $value));
+                                    $aMsg['date'] = trim(preg_replace('/\s+/', ' ', $value));
                                     break;
                                     break;
                                 case 'x-priority': $aMsg['x-priority'] = ($value) ? (int) $value[0] : 3; break;
                                 case 'x-priority': $aMsg['x-priority'] = ($value) ? (int) $value[0] : 3; break;
                                 case 'priority':
                                 case 'priority':