Ignore:
Timestamp:
05/12/10 09:23:03 (14 years ago)
Author:
rodsouza
Message:

Ticket #1073 - Resultado da busca corrigindo com caracteres nao permitidos

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0/expressoMail1_2/inc/class.imap_functions.inc.php

    r2740 r2758  
    30223022 
    30233023        function search_msg($params = ''){               
    3024                 $retorno = ""; 
    30253024                $mbox_stream = ""; 
    30263025                if(strpos($params['condition'],"#")===false) { //local messages 
     
    30763075                                                { 
    30773076                                                        foreach($search_criteria as $new_search){ 
    3078                                                                 $m_token = trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--".$new_search."##"."\n"); 
    3079                                                                 if(!@strstr($retorno,$m_token)) 
    3080                                                                         $retorno .= $m_token; 
     3077                                                                $elem = $this->get_msg_detail($new_search,$name_box,$mbox_stream); 
     3078                                                                $elem['boxname'] = mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ); 
     3079                                                                $elem['uid'] = $new_search; 
     3080                                                                $retorno[] = $elem; 
    30813081                                                        } 
    30823082                                                }                                                
     
    30903090                                        { 
    30913091                                                foreach($search_criteria as $new_search) 
    3092                                                         $retorno .= trim("##".mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ) . "--" . $this->get_msg($new_search,$name_box,$mbox_stream) . "--" . $new_search."##"."\n"); 
     3092                                                { 
     3093                                                        $elem = $this->get_msg_detail($new_search,$name_box,$mbox_stream); 
     3094                                                        $elem['boxname'] = mb_convert_encoding( $name_box, "ISO_8859-1", "UTF7-IMAP" ); 
     3095                                                        $elem['uid'] = $new_search; 
     3096                                                        $retorno[] = $elem; 
     3097                                                } 
    30933098                                        } 
    30943099                                } 
     
    30973102                if($mbox_stream) 
    30983103                        imap_close($mbox_stream);                
    3099                                                  
    31003104                return $retorno ? $retorno : "none"; 
    31013105        } 
    31023106         
    3103         function get_msg($uid_msg,$name_box, $mbox_stream ) 
     3107        function get_msg_detail($uid_msg,$name_box, $mbox_stream ) 
    31043108        { 
    31053109                $header = $this->get_header($uid_msg); 
    3106                 include_once("class.imap_attachment.inc.php"); 
     3110                require_once("class.imap_attachment.inc.php"); 
    31073111                $imap_attachment = new imap_attachment(); 
    31083112                $attachments =  $imap_attachment->get_attachment_headerinfo($mbox_stream, $uid_msg); 
     
    31213125                if($header->from[0]->personal != "") 
    31223126                        $from = $header->from[0]->personal; 
    3123                 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate)."--". $this->size_msg($header->Size) ."--". $flag; 
     3127                $ret_msg['from'] = $this->decode_string($from); 
     3128                $ret_msg['subject'] = $subject; 
     3129                $ret_msg['udate'] = $header ->udate; 
     3130                $ret_msg['size'] = $header->Size; 
     3131                $ret_msg['flag'] = $flag; 
    31243132                return $ret_msg;                     
    31253133        }        
    3126  
    3127         function size_msg($size){ 
    3128                 $var = floor($size/1024); 
    3129                 if($var >= 1){ 
    3130                         return $var." kb";       
    3131                 }else{ 
    3132                         return $size ." b";      
    3133                 } 
    3134         } 
    31353134 
    31363135        function ob_array($the_object) 
Note: See TracChangeset for help on using the changeset viewer.