[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] felamimail/inc class.bocompose.inc.php class.bo...
From: |
Sigurd Nes |
Subject: |
[Phpgroupware-cvs] felamimail/inc class.bocompose.inc.php class.bo... |
Date: |
Fri, 23 Feb 2007 19:40:41 +0000 |
CVSROOT: /sources/phpgroupware
Module name: felamimail
Changes by: Sigurd Nes <sigurdne> 07/02/23 19:40:41
Modified files:
inc : class.bocompose.inc.php
class.bofelamimail.inc.php
Log message:
utf-8
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.bocompose.inc.php?cvsroot=phpgroupware&r1=1.12&r2=1.13
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.bofelamimail.inc.php?cvsroot=phpgroupware&r1=1.21&r2=1.22
Patches:
Index: class.bocompose.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.bocompose.inc.php,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -b -r1.12 -r1.13
--- class.bocompose.inc.php 23 Feb 2007 14:45:08 -0000 1.12
+++ class.bocompose.inc.php 23 Feb 2007 19:40:41 -0000 1.13
@@ -11,7 +11,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\***************************************************************************/
- /* $Id: class.bocompose.inc.php,v 1.12 2007/02/23 14:45:08 sigurdne Exp
$ */
+ /* $Id: class.bocompose.inc.php,v 1.13 2007/02/23 19:40:41 sigurdne Exp
$ */
class bocompose
{
@@ -157,7 +157,7 @@
for($i=0; $i<count($bodyParts); $i++)
{
// $this->sessionData['body'] .=
$bodyParts[$i]['body'];
- $this->sessionData['body'] .= htmlentities(
$bodyParts[$i]['body'],ENT_COMPAT);
+ $this->sessionData['body'] .= htmlentities(
$bodyParts[$i]['body'],ENT_COMPAT,'UTF-8');
}
$this->sessionData['body'] .= "\n\n
-----------".lang('Forwarded Message')."-----------\n\n";
@@ -335,7 +335,7 @@
$value .= "\n";
$bodyAppend =
wordwrap($value,70,"\n",1);
$bodyAppend = str_replace("\n", "\n>",
$bodyAppend);
- $this->sessionData['body'] .=
htmlentities($bodyAppend,ENT_COMPAT);
+ $this->sessionData['body'] .=
htmlentities($bodyAppend,ENT_COMPAT,'UTF-8');
}
}
Index: class.bofelamimail.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.bofelamimail.inc.php,v
retrieving revision 1.21
retrieving revision 1.22
diff -u -b -r1.21 -r1.22
--- class.bofelamimail.inc.php 23 Feb 2007 14:45:08 -0000 1.21
+++ class.bofelamimail.inc.php 23 Feb 2007 19:40:41 -0000 1.22
@@ -11,7 +11,7 @@
* Free Software Foundation; either version 2 of the License, or (at
your *
* option) any later version.
*
\***************************************************************************/
- /* $Id: class.bofelamimail.inc.php,v 1.21 2007/02/23 14:45:08 sigurdne
Exp $ */
+ /* $Id: class.bofelamimail.inc.php,v 1.22 2007/02/23 19:40:41 sigurdne
Exp $ */
class bofelamimail
{
@@ -511,7 +511,10 @@
// parse structure to see if
attachments exist
// display icon if so
$structure =
imap_fetchstructure($this->mbox, $i);
+ if(is_array($structure->parameters))
+ {
$sections =
$this->parseMessage($structure);
+ }
$messageData['date'] =
$header->udate;
$messageData['subject'] =
(isset($header->subject)?$header->subject:'');
@@ -773,11 +776,22 @@
default:
// $newPart =
stripslashes(trim(imap_body($this->mbox, $_uid, FT_UID)));
$newPart =
imap_body($this->mbox, $_uid, FT_UID);
- //
_debug_array($structure->parameters[0]->value);
-
if(strtolower($structure->parameters[0]->value != 'utf-8'))
+
if(isset($structure->parameters) && is_array($structure->parameters))
+ {
+
if(strtolower($structure->parameters['value'] != 'utf-8'))
+ {
+ $newPart =
utf8_encode($newPart);
+ }
+ }
+ else
+ {
+ $parameters =
get_object_vars($structure->parameters); // fix this
+
+
if(!isset($parameters['value']) || strtolower($parameters['value'] != 'utf-8'))
{
$newPart =
utf8_encode($newPart);
}
+ }
// it is either not encoded or
we don't know about it
}
if(strtolower($structure->subtype) == 'html')
@@ -979,7 +993,7 @@
if (function_exists('imap_get_quotaroot'))
{
$quota =
@imap_get_quotaroot($this->mbox, $_folderName);
- if(is_array($quota['STORAGE']))
+ if(isset($quota['STORAGE']) &&
is_array($quota['STORAGE']))
{
$storage = $this->storageQuota
= $quota['STORAGE'];
}
@@ -1003,6 +1017,8 @@
$data['partID'] = $_partID;
$data["mimeType"] =
$mime_type."/". strtolower($_structure->subtype);
$data["name"] =
lang("unknown");
+ if(isset($_structure->parameters) &&
is_array($_structure->parameters))
+ {
for ($lcv = 0; $lcv <
count($_structure->parameters); $lcv++)
{
$param =
$_structure->parameters[$lcv];
@@ -1015,7 +1031,7 @@
$data["charset"] = $param->value;
break;
}
-
+ }
}
// set this to zero, when we have a
plaintext message