Changeset 1828 for branches/2.0/expressoMail1_2
- Timestamp:
- 12/14/09 15:46:28 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.0/expressoMail1_2/inc/class.imap_functions.inc.php
r1798 r1828 428 428 $return_get_body = $this->get_body_msg($msg_number, $msg_folder); 429 429 430 //Substituição de links em email para abrir no próprio expresso 431 $body = mb_ereg_replace("<a[^>]*href=[\'\"]mailto:([^\"\']+)[\'\"]>([^<]+)</a>","<a href=\"javascript:new_message_to('\\1')\">\\2</a>",$return_get_body['body']); 432 430 $body = $return_get_body['body']; 433 431 //Remoção de tags <span></span> para correção de erro no firefox 434 432 $body = mb_ereg_replace("<span><span>","",$body); … … 1015 1013 'applet','embed','frameset','xml','xmp','style'); 1016 1014 1017 $body = $this-> replace_links($body); 1018 $blocked_tags = array(); 1015 $blocked_tags = array(); 1019 1016 foreach($tag_list as $index => $tag) { 1020 1017 $new_body = @mb_eregi_replace("<$tag", "<!--$tag", $body); … … 1031 1028 $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 1032 1029 1033 return "<span>".$ body;1030 return "<span>".$this-> replace_links($body); 1034 1031 } 1035 1032 … … 1041 1038 if(count($matches)) 1042 1039 return $body; 1043 1044 $pattern = '/(?<=[\s\><\n\r;])((http(s?):\/\/((?:[\w]\.?)+(?::[\d]+)?[\/.\-~&=?%;@#,+\w:]*))|((?:www?\.)(?:\w\.?)*(?::\d+)?[\/\w.\-~&=?%;@+]*))/i'; 1045 $replacement = '<a href="http$3://$4$5" target="_blank">$1</a>'; 1046 return preg_replace($pattern, $replacement, $body); 1047 1048 // Original 1049 //return preg_replace('/(?<=[\s|(<br>)|\n|\r|;])((http(s?):\/\/((?:[\w]\.?)+(?::[\d]+)?[\/.\-~&=?%;@#,+\w]*))|((?:www?\.)(?:\w\.?)*(?::\d+)?[\/\w.\-~&=?%;@+]*))/i', '<a href="http$3://$4$5" target="_blank">http$3://$4$5</a>', $body); 1040 1041 /* Replace links tags <a href="" ></a> to links with target=_blank */ 1042 $pattern = '/<a[^>]+href="([^>"]+)"[^>]*>(.*)<\/a>/im'; 1043 $replacement = '<a href="$1" target="_blank">$2</a>'; 1044 $body = preg_replace($pattern, $replacement, $body); 1045 1046 /*Replace websites that does NOT begin with href=" to links */ 1047 $pattern = '/([^h][^r][^e][^f][^=][^"])((https?:\/\/)[A-Za-z0-9\.~?\/_=&#;\-:]*)/m'; 1048 $replacement = '$1<a href="$2" target="_blank">$2</a>'; 1049 $body = preg_replace($pattern, $replacement, $body); 1050 1051 /*Transform email address in new_message_to*/ 1052 $pattern = '/([A-Za-z0-9\.~?\/_=#\-]*@[A-Za-z0-9\.~?\/_=#\-]*)/im'; 1053 $replacement = '<a href="javascript:new_message_to(\'$1\')">$1</a>'; 1054 $body = preg_replace($pattern, $replacement, $body); 1055 1056 /*Subs. email links to expresso*/ 1057 $body = mb_ereg_replace("<a[^>]*href=[\'\"]mailto:([^\"\']+)[\'\"]>([^<]+)</a>", 1058 "<a href=\"javascript:new_message_to('\\1')\">\\2</a>",$body); 1059 1060 1061 return $body; 1050 1062 } 1051 1063
Note: See TracChangeset
for help on using the changeset viewer.