[Svn] r2533 - trunk/roundcubemail/program/lib

trac at roundcube.net trac at roundcube.net
Mon May 25 13:34:51 CEST 2009


Author: alec
Date: 2009-05-25 06:34:51 -0500 (Mon, 25 May 2009)
New Revision: 2533

Modified:
   trunk/roundcubemail/program/lib/imap.inc
Log:
- small LF fix in quoted-printable convertion


Modified: trunk/roundcubemail/program/lib/imap.inc
===================================================================
--- trunk/roundcubemail/program/lib/imap.inc	2009-05-25 11:14:22 UTC (rev 2532)
+++ trunk/roundcubemail/program/lib/imap.inc	2009-05-25 11:34:51 UTC (rev 2533)
@@ -2396,9 +2396,8 @@
 		                }
             			$bytes -= strlen($line);
 
-				$line = rtrim($line, "\t\r\n\0\x0B");
-
 		                if ($mode == 1) {
+					$line = rtrim($line, "\t\r\n\0\x0B");
 					// create chunks with proper length for base64 decoding
 					$line = $prev.$line;
 					$length = strlen($line);
@@ -2417,7 +2416,7 @@
 					else
 						$result .= base64_decode($line);
 				} else if ($mode == 2) {
-					$line .= $line[sizeof($line)-1] != '=' ? "\n" : '';
+					$line = rtrim($line, "\t\r\0\x0B");
 					if ($file)
 						fwrite($file, quoted_printable_decode($line));
             				else if ($print)
@@ -2425,6 +2424,7 @@
 					else
 						$result .= quoted_printable_decode($line);
 				} else if ($mode == 3) {
+					$line = rtrim($line, "\t\r\n\0\x0B");
 					if ($line == 'end' || preg_match('/^begin\s+[0-7]+\s+.+$/', $line))
 						continue;
 					if ($file)
@@ -2434,6 +2434,7 @@
 					else
 						$result .= convert_uudecode($line);
 				} else {
+					$line = rtrim($line, "\t\r\n\0\x0B");
 					if ($file)
 						fwrite($file, $line . "\n");
             			        else if ($print)
@@ -2443,6 +2444,7 @@
 				}
         		}
     		}
+
 	        // read in anything up until last line
 		if (!$end)
 			do {

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list