Changeset 5745 for trunk


Ignore:
Timestamp:
03/16/12 17:33:05 (12 years ago)
Author:
cristiano
Message:

Ticket #2469 - Trocada regex que limpa o css e problemas com envio de email em text/plain

Location:
trunk
Files:
5 edited

Legend:

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

    r5743 r5745  
    27592759                $body = mb_ereg_replace('<!--\[', '<!-- [', $params['body']); 
    27602760                $body = str_replace("%nbsp;","&nbsp;",$body); 
    2761                 $body = preg_replace("/\n/"," ",$body); 
    2762                 $body = preg_replace("/\r/","" ,$body); 
     2761                //$body = preg_replace("/\n/"," ",$body); 
     2762                //$body = preg_replace("/\r/","" ,$body); 
    27632763                $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );         
    27642764            } 
     
    28432843 
    28442844            $mailService->setSubject($subject); 
    2845             $isHTML = ( (array_key_exists('type', $params) && in_array(strtolower($params['type']), array('html', 'plain')) ) ? 
    2846                             strtolower($params['type']) != 'plain' : true ); 
     2845            $isHTML = ( isset($params['type']) && $params['type'] == 'html' )?  true : false; 
    28472846 
    28482847 
  • trunk/expressoMail1_2/js/main.js

    r5729 r5745  
    18141814           if (txtarea != null){ 
    18151815                  if (data.body != undefined) 
    1816                     txtarea.value = data.body; 
     1816                    txtarea.value = data.body.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1'); 
    18171817              if (preferences.use_signature == "1") 
    18181818            txtarea.value += '\n' + signature;      
     
    22092209        input_folder.style.display='none'; 
    22102210        input_folder.name = "folder"; 
    2211         input_folder.value = folder;       
     2211        input_folder.value = folder; 
     2212         
     2213        var input_type = document.createElement("INPUT"); 
     2214        input_type.style.display='none'; 
     2215        input_type.name = "type"; 
     2216        input_type.value = RichTextEditor.plain[ID] ? 'plain' : 'html'; 
    22122217         
    22132218        var uids = document.createElement("INPUT"); 
     
    22492254        form.appendChild(textArea); 
    22502255        form.appendChild(input_folder); 
     2256        form.appendChild(input_type); 
    22512257 
    22522258        // Implementação do In_Reply_To e References 
     
    35823588            form.folder = folder_id; 
    35833589            form.body = RichTextEditor.getData("body_"+border_id); 
    3584             form.attachments = listAttachment(border_id); 
     3590            form.type =  RichTextEditor.plain[border_id] ? 'plain' : 'html'; 
     3591            form.attachments = listAttachment(border_id) ; 
    35853592            form.uidsSave = uidsSave[border_id].toString(); 
    35863593            return( form ); 
  • trunk/expressoMail1_2/js/rich_text_editor.js

    r5604 r5745  
    226226     
    227227     if(this.plain[id] === true) 
    228      { 
    229                  if($('#'+id) !== undefined){ 
     228     {                
     229                data =  data.replace( new RegExp('<pre>((.\n*)*)</pre>'),'$1'); 
     230                 
     231                if($('#'+id) !== undefined){ 
    230232                        $('#'+id).val(data); 
    231233                 if (reply === undefined)        
  • trunk/library/CssToInlineStyles/css_to_inline_styles.php

    r5476 r5745  
    184184        { 
    185185                // remove classes 
    186                 $html = preg_replace('/(\s)+class="(.*)"(\s)+/U', ' ', $html); 
    187  
     186                $html = preg_replace('/(\s)+class="([^"])"/U', ' ', $html); 
     187                 
    188188                // remove IDs 
    189                 $html = preg_replace('/(\s)+id="(.*)"(\s)+/U', ' ', $html); 
     189                $html = preg_replace('/(\s)+id="([^"])"/U', ' ', $html); 
    190190 
    191191                // return 
  • trunk/prototype/services/ImapServiceAdapter.php

    r5711 r5745  
    398398                                $body = $data['body']; 
    399399                                $body = str_replace("%nbsp;","&nbsp;",$body); 
    400                                 $body = preg_replace("/\n/"," ",$body); 
    401                                 $body = preg_replace("/\r/","" ,$body); 
     400                                //$body = preg_replace("/\n/"," ",$body); 
     401                                //$body = preg_replace("/\r/","" ,$body); 
    402402                                $body = html_entity_decode ( $body, ENT_QUOTES , 'ISO-8859-1' );                                         
    403403 
     
    420420                                        $mailService->addHeaderField('Disposition-Notification-To', Config::me('mail')); 
    421421 
    422                                 $isHTML = ( ( array_key_exists( 'type', $data ) && in_array( strtolower( $data[ 'type' ] ), array( 'html', 'plain' ) ) ) ? strtolower( $data[ 'type' ] ) != 'plain' : true ); 
    423  
     422                                $isHTML = ( isset($data['type']) && $data['type'] == 'html' )?  true : false; 
     423                                                                   
    424424                                if (!$body) $body = ' '; 
    425425                                 
Note: See TracChangeset for help on using the changeset viewer.