diff --git a/include/bbcode.php b/include/bbcode.php index c341f37f97..3e3345035e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -672,10 +672,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal // $Text = mb_convert_encoding($Text, "UTF-8", 'HTML-ENTITIES'); //} + // Remove all hashtag addresses + if (!$tryoembed AND get_config("system", "remove_hashtags_on_export")) { + $pattern = '/#(.*?)<\/a>/is'; + $Text = preg_replace($pattern, '#$2', $Text); + } + call_hooks('bbcode',$Text); $a->save_timestamp($stamp1, "parser"); return $Text; } - diff --git a/include/html2plain.php b/include/html2plain.php index 1e3f407af4..677faa9d58 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -107,6 +107,12 @@ function html2plain($html, $wraplength = 75, $compact = false) $message = str_replace("\r", "", $html); + // replace all hashtag addresses + if (get_config("system", "remove_hashtags_on_export")) { + $pattern = '/#(.*?)<\/a>/is'; + $message = preg_replace($pattern, '#$2', $message); + } + $doc = new DOMDocument(); $doc->preserveWhiteSpace = false;