Changeset 398


Ignore:
Timestamp:
08/14/08 11:47:13 (16 years ago)
Author:
niltonneto
Message:

Ver ocorrência 281 do Trac.
Referente a inserção de imagem na mensagem.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

    r378 r398  
    15451545                 
    15461546                //      Build CID for embedded Images!!! 
    1547                 $pattern = '/src="([^"]*?show_embedded_attach.php\?msg_folder=(.+)?&msg_num=(.+)?&msg_part=(.+)?)"/isU'; 
     1547                $pattern = '/src="([^"]*?show_embedded_attach.php\?msg_folder=(.+)?&(amp;)?msg_num=(.+)?&(amp;)?msg_part=(.+)?)"/isU'; 
    15481548                $cid_imgs = ''; 
    15491549                $name_cid_files = array(); 
    15501550                preg_match_all($pattern,$mail->Body,$cid_imgs,PREG_PATTERN_ORDER); 
    15511551                $cid_array = array(); 
    1552                 foreach($cid_imgs[4] as $j => $val){ 
    1553                                 if ( !array_key_exists($cid_imgs[3][$j].$val, $cid_array) ) 
     1552                foreach($cid_imgs[6] as $j => $val){ 
     1553                                if ( !array_key_exists($cid_imgs[4][$j].$val, $cid_array) ) 
    15541554                        { 
    1555                 $cid_array[$cid_imgs[3][$j].$val] = base_convert(microtime(), 10, 36); 
     1555                $cid_array[$cid_imgs[4][$j].$val] = base_convert(microtime(), 10, 36); 
    15561556                        } 
    1557                         $cid = $cid_array[$cid_imgs[3][$j].$val];  
     1557                        $cid = $cid_array[$cid_imgs[4][$j].$val];  
    15581558                        $mail->Body = str_replace($cid_imgs[1][$j], "cid:".$cid, $mail->Body); 
    15591559                         
    1560                                 if ($msg_uid != $cid_imgs[3][$j]) // The image isn't in the same mail? 
     1560                                if ($msg_uid != $cid_imgs[4][$j]) // The image isn't in the same mail? 
    15611561                                { 
    1562                                         $fileContent = $this->get_forwarding_attachment($cid_imgs[2][$j], $cid_imgs[3][$j], $cid_imgs[4][$j], 'base64'); 
     1562                                        $fileContent = $this->get_forwarding_attachment($cid_imgs[2][$j], $cid_imgs[4][$j], $cid_imgs[6][$j], 'base64'); 
     1563                                        //prototype: get_forwarding_attachment ( folder, msg number, part, encoding) 
    15631564                                        $fileName = "image_".($j).".jpg"; 
    15641565                                        $fileCode = "base64"; 
    15651566                                        $fileType = "image/jpg"; 
     1567                                        $file_attached[0] = $cid_imgs[2][$j]; 
     1568                                        $file_attached[1] = $cid_imgs[4][$j]; 
     1569                                        $file_attached[2] = $fileName; 
     1570                                        $file_attached[3] = $cid_imgs[6][$j]; 
     1571                                        $file_attached[4] = 'base64'; 
     1572                                        $file_attached[5] = strlen($fileContent); //Size of file 
     1573                                        $return_forward[] = $file_attached; 
    15661574                                } 
    15671575                                else 
    15681576                                { 
    1569                                         $attach_img = $forwarding_attachments[$cid_imgs[4][$j]-2]; 
     1577                                        $attach_img = $forwarding_attachments[$cid_imgs[6][$j]-2]; 
    15701578                                        $file_description = unserialize(rawurldecode($attach_img)); 
    15711579                                        foreach($file_description as $i => $descriptor){                                 
     
    15761584                                        $fileCode = $file_description[4]; 
    15771585                                        $fileType = $this->get_file_type($file_description[2]); 
    1578                                         unset($forwarding_attachments[$cid_imgs[4][$j]-2]); 
     1586                                        unset($forwarding_attachments[$cid_imgs[6][$j]-2]); 
    15791587                                        if (!empty($file_description)) 
    15801588                                        { 
Note: See TracChangeset for help on using the changeset viewer.