$Text = preg_replace('/\"\;/','"',$Text);
// fix any escaped ampersands that may have been converted into links
- $Text = preg_replace("/\<(.*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
- $Text = preg_replace("/\<(.*?)(src|href)=\"[^hfm](.*?)\>/ism",'<$1$2="">',$Text);
+ $Text = preg_replace("/\<([^>]*?)(src|href)=(.*?)\&\;(.*?)\>/ism",'<$1$2=$3&$4>',$Text);
+ $Text = preg_replace("/\<([^>]*?)(src|href)=\"(?!http|ftp|mailto|cid)(.*?)\>/ism",'<$1$2="">',$Text);
if($saved_image)
$Text = bb_replace_images($Text, $saved_image);
// $Text = mb_convert_encoding($Text, "UTF-8", 'HTML-ENTITIES');
//}
+ // Remove all hashtag addresses
+ if (!$tryoembed) {
+ $pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
+ $Text = preg_replace($pattern, '#$2', $Text);
+ }
+
call_hooks('bbcode',$Text);
$a->save_timestamp($stamp1, "parser");