Permalink
Browse files

Little improvements for message parsing and encoding

  • Loading branch information...
1 parent bf04525 commit 2f2f15b7aabe19e45dad9bddb7eb7f4394aa1e21 @thomascube thomascube committed Sep 4, 2006
Showing with 18 additions and 11 deletions.
  1. +14 −8 index.php
  2. +1 −1 program/include/main.inc
  3. +3 −2 program/include/rcube_imap.inc
View
@@ -2,7 +2,7 @@
/*
+-----------------------------------------------------------------------+
| RoundCube Webmail IMAP Client |
- | Version 0.1-20060901 |
+ | Version 0.1-20060904 |
| |
| Copyright (C) 2005-2006, RoundCube Dev. - Switzerland |
| Licensed under the GNU GPL |
@@ -40,7 +40,7 @@
*/
-define('RCMAIL_VERSION', '0.1-20060901');
+define('RCMAIL_VERSION', '0.1-20060904');
// define global vars
$CHARSET = 'UTF-8';
@@ -87,12 +87,6 @@
// set PEAR error handling
// PEAR::setErrorHandling(PEAR_ERROR_TRIGGER, E_USER_NOTICE);
-// use gzip compression if supported
-if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression'))
- ob_start('ob_gzhandler');
-else
- ob_start();
-
// catch some url/post parameters
$_task = get_input_value('_task', RCUBE_INPUT_GPC);
@@ -104,6 +98,18 @@
if (!empty($_GET['_remote']))
$REMOTE_REQUEST = TRUE;
+
+
+// set output buffering
+if ($_action != 'get' && $_action != 'viewsource')
+ {
+ // use gzip compression if supported
+ if (function_exists('ob_gzhandler') && !ini_get('zlib.output_compression'))
+ ob_start('ob_gzhandler');
+ else
+ ob_start();
+ }
+
// start session with requested task
rcmail_startup($_task);
@@ -842,7 +842,7 @@ function rcube_charset_convert($str, $from, $to=NULL)
$from = strtoupper($from);
$to = $to==NULL ? strtoupper($GLOBALS['CHARSET']) : strtoupper($to);
- if ($from==$to || $str=='')
+ if ($from==$to || $str=='' || empty($from))
return $str;
// convert charset using mbstring module
@@ -1010,10 +1010,11 @@ class rcube_imap
// get part size
if (!empty($part[6]) && $part[6]!='NIL')
$struct->size = intval($part[6]);
-
+
// read part disposition
$di = count($part) - 2;
- if (is_array($part[$di]))
+ if ((is_array($part[$di]) && count($part[$di]) == 2 && is_array($part[$di][1])) ||
+ (is_array($part[--$di]) && count($part[$di]) == 2))
{
$struct->disposition = strtolower($part[$di][0]);

0 comments on commit 2f2f15b

Please sign in to comment.