phpgroupware-cvs
[Top][All Lists]
Advanced

[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: Thu, 21 Dec 2006 12:34:39 +0000

CVSROOT:        /sources/phpgroupware
Module name:    felamimail
Changes by:     Sigurd Nes <sigurdne>   06/12/21 12:34:39

Modified files:
        inc            : class.bocompose.inc.php 
                         class.bofelamimail.inc.php 
                         class.socaching.inc.php class.uidisplay.inc.php 
                         class.uifelamimail.inc.php 

Log message:
        notices and utf

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.bocompose.inc.php?cvsroot=phpgroupware&r1=1.5&r2=1.6
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.bofelamimail.inc.php?cvsroot=phpgroupware&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.socaching.inc.php?cvsroot=phpgroupware&r1=1.7&r2=1.8
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.uidisplay.inc.php?cvsroot=phpgroupware&r1=1.8&r2=1.9
http://cvs.savannah.gnu.org/viewcvs/felamimail/inc/class.uifelamimail.inc.php?cvsroot=phpgroupware&r1=1.10&r2=1.11

Patches:
Index: class.bocompose.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.bocompose.inc.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -b -r1.5 -r1.6
--- class.bocompose.inc.php     18 Dec 2006 20:03:32 -0000      1.5
+++ class.bocompose.inc.php     21 Dec 2006 12:34:39 -0000      1.6
@@ -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.5 2006/12/18 20:03:32 sigurdne Exp 
$ */
+       /* $Id: class.bocompose.inc.php,v 1.6 2006/12/21 12:34:39 sigurdne Exp 
$ */
 
        class bocompose
        {
@@ -336,7 +336,7 @@
                                        $value .= "\n";
                                        $bodyAppend = 
wordwrap($value,70,"\n",1);
                                        $bodyAppend = str_replace("\n", "\n>", 
$bodyAppend);
-                                       $this->sessionData['body'] .= 
htmlentities($bodyAppend);
+                                       $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.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- class.bofelamimail.inc.php  20 Dec 2006 13:56:26 -0000      1.13
+++ class.bofelamimail.inc.php  21 Dec 2006 12:34:39 -0000      1.14
@@ -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.13 2006/12/20 13:56:26 sigurdne 
Exp $ */
+       /* $Id: class.bofelamimail.inc.php,v 1.14 2006/12/21 12:34:39 sigurdne 
Exp $ */
 
        class bofelamimail
        {
@@ -512,10 +512,10 @@
                                        $sections = 
$this->parseMessage($structure);
                                        
                                        $messageData['date']            = 
$header->udate;
-                                       $messageData['subject']         = 
$header->subject;
+                                       $messageData['subject']         = 
(isset($header->subject)?$header->subject:'');
                                        $messageData['to_name']         = 
(isset($header->to[0]->personal)?$header->to[0]->personal:'');
-                                       $messageData['to_address']      = 
$header->to[0]->mailbox."@".$header->to[0]->host;
-                                       $messageData['sender_name']     = 
$header->from[0]->personal;
+                                       $messageData['to_address']      = 
(isset($header->to[0]->mailbox) && $header->to[0]->mailbox ? 
$header->to[0]->mailbox."@".$header->to[0]->host :'');
+                                       $messageData['sender_name']     = 
(isset($header->from[0]->personal)?$header->from[0]->personal:'');
                                        $messageData['sender_address']  = 
$header->from[0]->mailbox."@".$header->from[0]->host;
                                        $messageData['size']            = 
$header->Size;
                                        
@@ -1127,6 +1127,8 @@
                                        
$retData['attachment'][$_partID]['partID']      = $_partID;
                                        
$retData['attachment'][$_partID]["mimeType"]    = $mime_type."/". 
strtolower($_structure->subtype);
                                        
$retData['attachment'][$_partID]["name"]        = lang("unknown");
+                                       if(isset($_structure->dparameters) && 
is_array($_structure->dparameters))
+                                       {
                                        for ($lcv = 0; $lcv < 
count($_structure->dparameters); $lcv++)
                                        {
                                                $param = 
$_structure->dparameters[$lcv];
@@ -1137,6 +1139,7 @@
                                                                break;
                                                }
                                        }
+                                       }
                                        break;
                                        
                                case TYPEAUDIO:
@@ -1166,6 +1169,8 @@
                                        
$retData['attachment'][$_partID]['partID']      = $_partID;
                                        
$retData['attachment'][$_partID]["mimeType"]    = $mime_type."/". 
strtolower($_structure->subtype);
                                        
$retData['attachment'][$_partID]["name"]        = lang("unknown");
+                                       if(isset($_structure->dparameters) && 
is_array($_structure->dparameters))
+                                       {
                                        for ($lcv = 0; $lcv < 
count($_structure->dparameters); $lcv++)
                                        {
                                                $param = 
$_structure->dparameters[$lcv];
@@ -1176,6 +1181,7 @@
                                                                break;
                                                }
                                        }
+                                       }
                                        break;
                                        
                                case TYPEVIDEO:

Index: class.socaching.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.socaching.inc.php,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -b -r1.7 -r1.8
--- class.socaching.inc.php     19 Dec 2006 15:20:36 -0000      1.7
+++ class.socaching.inc.php     21 Dec 2006 12:34:39 -0000      1.8
@@ -11,7 +11,7 @@
        * Free Software Foundation; either version 2 of the License, or (at 
your    *
        * option) any later version.                                            
    *
        
\***************************************************************************/
-       /* $Id: class.socaching.inc.php,v 1.7 2006/12/19 15:20:36 sigurdne Exp 
$ */
+       /* $Id: class.socaching.inc.php,v 1.8 2006/12/21 12:34:39 sigurdne Exp 
$ */
 
        class socaching
        {
@@ -33,16 +33,30 @@
                
                function addToCache($_data)
                {
-                       $query = sprintf("insert into phpgw_felamimail_cache ".
+                       $values = array
+                       (
+                               $this->accountid,
+                               $this->db->db_addslashes($this->hostname),
+                               $this->db->db_addslashes($this->foldername),
+                               $this->db->db_addslashes($this->accountname), 
+                               $_data['uid'],
+                               $_data['date'],
+                               
$this->db->db_addslashes(utf8_encode($_data['subject'])),
+                               
$this->db->db_addslashes(utf8_encode($_data['sender_name'])),
+                               
$this->db->db_addslashes(utf8_encode($_data['sender_address'])),
+                               
$this->db->db_addslashes(utf8_encode($_data['to_name'])),
+                               
$this->db->db_addslashes(utf8_encode($_data['to_address'])),
+                               $_data['size'],
+                               $_data['attachments']
+                       );
+
+               $values = $this->db->validate_insert($values);
+
+                       $query = "INSERT INTO phpgw_felamimail_cache ".
                                         "(accountid, hostname, foldername, 
accountname, uid, date, subject, sender_name, sender_address, to_name, 
to_address, size, attachments) ".
-                                        
"values('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",
-                                        $this->accountid, 
addslashes($this->hostname), 
-                                        addslashes($this->foldername), 
addslashes($this->accountname), 
-                                        $_data['uid'], $_data['date'], 
addslashes($_data['subject']),
-                                        addslashes($_data['sender_name']), 
addslashes($_data['sender_address']),
-                                        addslashes($_data['to_name']), 
addslashes($_data['to_address']),
-                                        $_data['size'],$_data['attachments']);
-                       $this->db->query($query);
+                                        "values($values)";
+
+                       $this->db->query($query,__LINE__,__FILE__);
                        
                        #print "$query<br>";
                }
@@ -83,8 +97,8 @@
                        
                        $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address, size, attachments from 
phpgw_felamimail_cache ".
                                         "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s $sort",
-                                        $this->accountid, 
addslashes($this->hostname),
-                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $this->accountid, 
$this->db->db_addslashes($this->hostname),
+                                        
$this->db->db_addslashes($this->foldername), 
$this->db->db_addslashes($this->accountname),
                                         $filter);
                        
                        if($_firstMessage == '' && $_numberOfMessages == '')
@@ -175,8 +189,8 @@
                        
                        $query = sprintf("select count(*) as count from 
phpgw_felamimail_cache ".
                                         "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s",
-                                        $this->accountid, 
addslashes($this->hostname),
-                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $this->accountid, 
$this->db->db_addslashes($this->hostname),
+                                        
$this->db->db_addslashes($this->foldername), 
$this->db->db_addslashes($this->accountname),
                                         $filter);
                        #print "<br>$query<br>";
                        
@@ -195,8 +209,8 @@
                        
                        $query = sprintf("select uid, date, subject, 
sender_name, sender_address, to_name, to_address from phpgw_felamimail_cache ".
                                         "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' %s $sort",
-                                        $this->accountid, 
addslashes($this->hostname),
-                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $this->accountid, 
$this->db->db_addslashes($this->hostname),
+                                        
$this->db->db_addslashes($this->foldername), 
$this->db->db_addslashes($this->accountname),
                                         $filter);
 
                        $this->db->query($query,__LINE__,__FILE__);
@@ -261,8 +275,8 @@
                        $query = sprintf("delete from phpgw_felamimail_cache ".
                                         "where accountid='%s' and 
hostname='%s' and foldername = '%s' and accountname='%s' ".
                                         "and uid='%s'",
-                                        $this->accountid, 
addslashes($this->hostname),
-                                        addslashes($this->foldername), 
addslashes($this->accountname),
+                                        $this->accountid, 
$this->db->db_addslashes($this->hostname),
+                                        
$this->db->db_addslashes($this->foldername), 
$this->db->db_addslashes($this->accountname),
                                         $_uid);
                        $this->db->query($query);
                        
@@ -273,16 +287,16 @@
                {
                        $query = sprintf("delete from 
phpgw_felamimail_folderstatus where ".
                                 "accountid='%s' and hostname='%s' and 
foldername='%s' and accountname='%s'",
-                                $this->accountid, addslashes($this->hostname),
-                                addslashes($this->foldername), 
addslashes($this->accountname));
+                                $this->accountid, 
$this->db->db_addslashes($this->hostname),
+                                $this->db->db_addslashes($this->foldername), 
$this->db->db_addslashes($this->accountname));
                        $this->db->query($query);
 
                        $values = array
                        (
                                $this->accountid,
-                               addslashes($this->hostname),
-                               addslashes($this->foldername),
-                               addslashes($this->accountname),
+                               $this->db->db_addslashes($this->hostname),
+                               $this->db->db_addslashes($this->foldername),
+                               $this->db->db_addslashes($this->accountname),
                                $_status->messages,
                                $_status->recent,
                                $_status->unseen,

Index: class.uidisplay.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.uidisplay.inc.php,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -b -r1.8 -r1.9
--- class.uidisplay.inc.php     20 Dec 2006 13:56:26 -0000      1.8
+++ class.uidisplay.inc.php     21 Dec 2006 12:34:39 -0000      1.9
@@ -11,7 +11,7 @@
        * Free Software Foundation; either version 2 of the License, or (at 
your    *
        * option) any later version.                                            
    *
        
\***************************************************************************/
-       /* $Id: class.uidisplay.inc.php,v 1.8 2006/12/20 13:56:26 sigurdne Exp 
$ */
+       /* $Id: class.uidisplay.inc.php,v 1.9 2006/12/21 12:34:39 sigurdne Exp 
$ */
 
        class uidisplay
        {
@@ -464,6 +464,8 @@
                                // add line breaks to $bodyParts
                                #$newBody       = 
wordwrap($bodyParts[$i],90,"\n",1);
                                #$newBody       = 
wordwrap($bodyParts[$i],90,"<br>",1);
+                               $bodyParts[$i]['body'] = 
utf8_encode($bodyParts[$i]['body']);
+                               
                                if($bodyParts[$i]['mimeType'] == 'text/plain')
                                {
                                        #$newBody       = 
ereg_replace("\n","<br>",$bodyParts[$i]['body']);

Index: class.uifelamimail.inc.php
===================================================================
RCS file: /sources/phpgroupware/felamimail/inc/class.uifelamimail.inc.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- class.uifelamimail.inc.php  19 Dec 2006 15:20:36 -0000      1.10
+++ class.uifelamimail.inc.php  21 Dec 2006 12:34:39 -0000      1.11
@@ -11,7 +11,7 @@
        * Free Software Foundation; either version 2 of the License, or (at 
your    *
        * option) any later version.                                            
    *
        
\***************************************************************************/
-       /* $Id: class.uifelamimail.inc.php,v 1.10 2006/12/19 15:20:36 sigurdne 
Exp $ */
+       /* $Id: class.uifelamimail.inc.php,v 1.11 2006/12/21 12:34:39 sigurdne 
Exp $ */
 
        class uifelamimail
        {
@@ -209,32 +209,37 @@
                                                                        
$GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
                        
-                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_deleted"]) &&
-                               is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
+                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_deleted"])
+                               && isset($GLOBALS['HTTP_POST_VARS']["msg"])
+                               && is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
                                
$this->bofelamimail->deleteMessages($GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
                        
-                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unread"]) &&
-                               is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
+                       elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unread"])
+                               && isset($GLOBALS['HTTP_POST_VARS']["msg"])
+                               && is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
                                
$this->bofelamimail->flagMessages("unread",$GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
                        
-                       elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_read"]) 
&&
-                               is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
+                       elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_read"])
+                               && isset($GLOBALS['HTTP_POST_VARS']["msg"])
+                               && is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
                                
$this->bofelamimail->flagMessages("read",$GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
                        
-                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unflagged"]) &&
-                               is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
+                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_unflagged"])
+                               && isset($GLOBALS['HTTP_POST_VARS']["msg"])
+                               && is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
                                
$this->bofelamimail->flagMessages("unflagged",$GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
                        
-                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_flagged"]) &&
-                               is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
+                       
elseif(!empty($GLOBALS['HTTP_POST_VARS']["mark_flagged"])
+                               && isset($GLOBALS['HTTP_POST_VARS']["msg"])
+                               && is_array($GLOBALS['HTTP_POST_VARS']["msg"]))
                        {
                                
$this->bofelamimail->flagMessages("flagged",$GLOBALS['HTTP_POST_VARS']["msg"]);
                        }
@@ -392,7 +397,7 @@
                        $this->t->set_var('filter_options',$filterUI);
                        // 0 == quicksearch
                        if($activeFilter == '0')
-                               
$this->t->set_var('quicksearch',$filterList[0]['subject']);
+                               
$this->t->set_var('quicksearch',(isset($filterList[0]['subject'])?$filterList[0]['subject']:''));
                        
                        // create the urls for sorting
                        switch($this->sort)
@@ -452,18 +457,18 @@
                                                {
                                                        
$headers['header'][$i]['subject'] = 
substr($headers['header'][$i]['subject'],0,$maxSubjectLength)."...";
                                                }
-                                               
$headers['header'][$i]['subject'] = 
htmlentities($headers['header'][$i]['subject']);
+               
+                                               
$headers['header'][$i]['subject'] = 
htmlentities($headers['header'][$i]['subject'],ENT_COMPAT,'UTF-8');
                                                
if($headers['header'][$i]['attachments'] == "true")
                                                {
                                                        $image = '<img 
src="'.$GLOBALS['phpgw']->common->image('felamimail','attach').'" border="0">';
                                                        
$headers['header'][$i]['subject'] = 
"$image&nbsp;".$headers['header'][$i]['subject'];
                                                }
                                                
$this->t->set_var('header_subject', $headers['header'][$i]['subject']);
-                                       
                                        }
                                        else
                                        {
-                                               
$this->t->set_var('header_subject',htmlentities("(".lang('no subject').")"));
+                                               
$this->t->set_var('header_subject',htmlentities("(".lang('no 
subject').")",ENT_COMPAT,'UTF-8'));
                                        }
                                
                                        if 
(isset($mailPreferences['sent_folder']) && $mailPreferences['sent_folder'] == 
$this->mailbox)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]