Ticket #783: r5-r6-#2_#783.diff

File r5-r6-#2_#783.diff, 2.7 KB (added by wmerlotto, 14 years ago)

Patch para suprimir o aparecimento dos endif tanto no Expresso quanto no Outlook

  • trunk/expressoMail1_2/inc/class.imap_functions.inc.php

     
    428428                $return_get_body = $this->get_body_msg($msg_number, $msg_folder); 
    429429                 
    430430                $body = $return_get_body['body']; 
    431                 //Remoção de tags <span></span> para correção de erro no firefox 
    432                 $body = mb_eregi_replace("<span><span>","",$body); 
    433                 $body = mb_eregi_replace("</span></span>","",$body); 
    434431                 
    435432                if($return_get_body['body']=='isCripted'){ 
    436433                        $exporteml = new ExportEml(); 
     
    10751072                $tag_list = Array('head','blink','object','frame', 
    10761073                        'iframe','layer','ilayer','plaintext','script', 
    10771074                        'applet','embed','frameset','xml','xmp','style'); 
    1078  
     1075                 
    10791076                $blocked_tags = array(); 
    10801077                foreach($tag_list as $index => $tag) { 
    10811078                        $new_body = @mb_eregi_replace("<$tag", "<!--$tag", $body); 
     
    10841081                        } 
    10851082                        $body = @mb_eregi_replace("</$tag>", "</$tag-->", $new_body); 
    10861083                } 
     1084 
    10871085                // Malicious Code Remove 
    10881086                $dirtyCodePattern = "/(<([\w]+[\w0-9]*)(.*)on(mouse(move|over|down|up)|load|blur|change|error|click|dblclick|focus|key(down|up|press)|select)([\n\ ]*)=([\n\ ]*)[\"'][^>\"']*[\"']([^>]*)>)(.*)(<\/\\2>)?/misU"; 
    10891087                preg_match_all($dirtyCodePattern,$body,$rest,PREG_PATTERN_ORDER); 
    10901088                foreach($rest[0] as $i => $val) 
    10911089                        if (!(preg_match("/javascript:window\.open\(\"([^'\"]*)\/index\.php\?menuaction=calendar\.uicalendar\.set_action\&cal_id=([^;'\"]+);?['\"]/i",$rest[1][$i]) && strtoupper($rest[4][$i]) == "CLICK" )) //Calendar events 
    1092                         $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 
     1090                                $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 
    10931091 
    1094                 return  "<span>".$this-> replace_links($body); 
     1092                $body = $this-> replace_links($body); 
     1093                 
     1094                //Remoção de tags <span></span> para correção de erro no firefox 
     1095                $body = mb_eregi_replace("<span><span>","",$body); 
     1096                $body = mb_eregi_replace("</span></span>","",$body); 
     1097                //Correção para compatibilização com Outlook, ao visualizar a mensagem 
     1098                $body = mb_ereg_replace('<!--\[','<!-- [',$body); 
     1099                $body = mb_ereg_replace('&lt;!\[endif\]--&gt;', '<![endif]-->', $body); 
     1100                         
     1101                return  "<span>".$body; 
    10951102        } 
    10961103 
    10971104        function replace_links($body) 
     
    17721779        else 
    17731780        { 
    17741781            $body = $params['body']; 
     1782                        //Compatibilização com Outlook, ao encaminhar a mensagem 
     1783            $body = mb_ereg_replace('<!--\[','<!-- [',$body); 
    17751784        } 
    17761785                //echo "<script language=\"javascript\">javascript:alert('".$body."');</script>"; 
    17771786                $attachments = $params['FILES'];