Changeset 6242


Ignore:
Timestamp:
05/18/12 17:56:02 (12 years ago)
Author:
cristiano
Message:

Ticket #2724 - CorRevertido? codigo commitado por engano

File:
1 edited

Legend:

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

    r6240 r6242  
    30753075            //////////////////////////////////////////////////////////////////////////////////////////////////// 
    30763076 
    3077              
    3078             $this->rfc2397ToEmbeddedAttachment($mailService , $body); 
    3079              
    30803077            if ($isHTML) 
    30813078                $mailService->setBodyHtml($body); 
     
    37313728                return "application/octet-stream"; 
    37323729        } 
    3733          
    3734          
     3730 
    37353731        function htmlspecialchars_encode($str) 
    37363732        { 
     
    52755271                return $ret; 
    52765272        } 
    5277          
    5278         /** 
    5279          * Método que convert imagens no formato rfc2397 para Embedded Attachment 
    5280          * 
    5281          * @license    http://www.gnu.org/copyleft/gpl.html GPL 
    5282          * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 
    5283          * @sponsor     Caixa Econômica Federal 
    5284          * @author     Cristiano Corrêa Schmidt 
    5285          * @param      <MailService> <$mailService> <Referencia objeto MailService> 
    5286          * @param      <String> <$body> <Referencia Corpo do email> 
    5287          * @return     <void> 
    5288          * @access     <public> 
    5289          */ 
    5290         function rfc2397ToEmbeddedAttachment( &$mailService , &$body ) 
    5291         {  
    5292                 $matches = array(); 
    5293                 preg_match_all("/src=[\'|\"]+data:([^;]*)(.*);base64,([a-zA-Z0-9\+\/\=]+)[\'|\"]+/i", $body, $matches,  PREG_SET_ORDER); //Resgata imagens em rfc2397 
    5294                                  
    5295                 foreach ($matches as $i => &$v) 
    5296                 { 
    5297                         $mailService->addStringImage(base64_decode($v[3]), $v[1] , 'EmbeddedImage'.$i.'.'.$this->mimeToExtension($v[1])); 
    5298                         $body = str_replace($v[0], 'src="EmbeddedImage'.$i.'.'.$this->mimeToExtension($v[1]).'"' , $body); 
    5299                 } 
    5300         } 
    5301          
    5302         /** 
    5303          * Método que retorna a extensão do arquivo atraves do mime type 
    5304          * 
    5305          * @license    http://www.gnu.org/copyleft/gpl.html GPL 
    5306          * @author     Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) 
    5307          * @sponsor     Caixa Econômica Federal 
    5308          * @author     Cristiano Corrêa Schmidt 
    5309          * @param      <String> <$mimeType> <Mime Type do arquivo> 
    5310          * @return     <String> <extensão> 
    5311          * @access     <public> 
    5312          */ 
    5313         function mimeToExtension($mimeType) 
    5314         { 
    5315                 switch ( $mimeType )  
    5316                 {        
    5317                         case 'image/bmp' :  
    5318                                 return 'bmp'; 
    5319                         case 'image/cgm' : 
    5320                                 return 'cgm'; 
    5321                         case 'image/vnd.djvu' :  
    5322                                 return 'djv'; 
    5323                         case 'image/gif' : 
    5324                                 return 'gif'; 
    5325                         case 'image/x-icon' : 
    5326                                 return 'ico'; 
    5327                         case 'image/ief' : 
    5328                                 return 'ief'; 
    5329                         case 'image/jpeg' : 
    5330                                 return 'jpg'; 
    5331                         case 'image/x-macpaint' : 
    5332                                 return 'mac'; 
    5333                         case 'image/pict' : 
    5334                                 return 'pct'; 
    5335                         case 'image/png' : 
    5336                                 return 'png'; 
    5337                         case 'image/x-quicktime' : 
    5338                                 return 'qti'; 
    5339                         case 'image/x-rgb' : 
    5340                                 return 'rgb'; 
    5341                         case 'image/tiff' : 
    5342                                 return 'tif'; 
    5343                         default: 
    5344                                 return ''; 
    5345                 } 
    5346                  
    5347         } 
    5348          
    53495273} 
    53505274?> 
Note: See TracChangeset for help on using the changeset viewer.