Changeset 1707
- Timestamp:
- 11/25/09 14:49:16 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/expressoMail1_2/inc/class.imap_functions.inc.php
r1638 r1707 452 452 453 453 $return_get_body = $this->get_body_msg($msg_number, $msg_folder); 454 455 //Substituição de links em email para abrir no próprio expresso 456 $body = mb_ereg_replace("<a[^>]*href=[\'\"]mailto:([^\"\']+)[\'\"]>([^<]+)</a>","<a href=\"javascript:new_message_to('\\1')\">\\2</a>",$return_get_body['body']); 454 455 $body = $return_get_body['body']; 457 456 //Remoção de tags <span></span> para correção de erro no firefox 458 457 $body = mb_ereg_replace("<span><span>","",$body); … … 471 470 $return['thumbs'] = $return_get_body['thumbs']; 472 471 $return['signature'] = $return_get_body['signature']; 473 } 472 } 473 474 474 $pattern = '/^[ \t]*Disposition-Notification-To(^:)*:(.+)*@(.+)*$/isUm'; 475 475 if (preg_match($pattern, $header_, $fields)) … … 703 703 $return['login'] = $_SESSION['phpgw_info']['expressomail']['user']['account_id'];//$GLOBALS['phpgw_info']['user']['account_id']; 704 704 $return['reply_toaddress'] = $header->reply_toaddress; 705 706 705 return $return; 707 706 } … … 1052 1051 'applet','embed','frameset','xml','xmp','style'); 1053 1052 1054 $body = $this-> replace_links($body);1055 1053 $blocked_tags = array(); 1056 1054 foreach($tag_list as $index => $tag) { … … 1068 1066 $body = str_replace($rest[1][$i],"<".$rest[2][$i].$rest[3][$i].$rest[7][$i].">",$body); 1069 1067 1070 return "<span>".$ body;1068 return "<span>".$this-> replace_links($body); 1071 1069 } 1072 1070 … … 1078 1076 if(count($matches)) 1079 1077 return $body; 1080 1081 $pattern = '/(?<=[\s\><\n\r;])((http(s?):\/\/((?:[\w]\.?)+(?::[\d]+)?[\/.\-~&=?%;@#,+\w:]*))|((?:www?\.)(?:\w\.?)*(?::\d+)?[\/\w.\-~&=?%;@+]*))/i'; 1082 1083 $replacement = '<a href="http$3://$4$5" target="_blank">$1</a>'; 1084 return preg_replace($pattern, $replacement, $body); 1085 1086 // Original 1087 //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); 1078 1079 /* Replace links tags <a href="" ></a> to links with target=_blank */ 1080 $pattern = '/<a[^>]+href="([^>"]+)"[^>]*>(.*)<\/a>/im'; 1081 $replacement = '<a href="$1" target="_blank">$2</a>'; 1082 $body = preg_replace($pattern, $replacement, $body); 1083 1084 /*Replace websites that does NOT begin with href=" to links */ 1085 $pattern = '/([^h][^r][^e][^f][^=][^"])((https?:\/\/)[A-Za-z0-9\.~?\/_=&#;\-:]*)/m'; 1086 $replacement = '$1<a href="$2" target="_blank">$2</a>'; 1087 $body = preg_replace($pattern, $replacement, $body); 1088 1089 /*Transform email address in new_message_to*/ 1090 $pattern = '/([A-Za-z0-9\.~?\/_=#\-]*@[A-Za-z0-9\.~?\/_=#\-]*)/im'; 1091 $replacement = '<a href="javascript:new_message_to(\'$1\')">$1</a>'; 1092 $body = preg_replace($pattern, $replacement, $body); 1093 1094 /*Subs. email links to expresso*/ 1095 $body = mb_ereg_replace("<a[^>]*href=[\'\"]mailto:([^\"\']+)[\'\"]>([^<]+)</a>", 1096 "<a href=\"javascript:new_message_to('\\1')\">\\2</a>",$body); 1097 1098 1099 return $body; 1088 1100 } 1089 1101
Note: See TracChangeset
for help on using the changeset viewer.