removing of hashtag addresses is now hidden behind a configuration

This commit is contained in:
Michael Vogel 2013-05-19 11:08:08 +02:00
parent 5ef6bdf88a
commit 0723933c1c
2 changed files with 5 additions and 4 deletions

View File

@ -673,7 +673,7 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
//}
// Remove all hashtag addresses
if (!$tryoembed) {
if (!$tryoembed AND get_config("system", "remove_hashtags_on_export")) {
$pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
$Text = preg_replace($pattern, '#$2', $Text);
}
@ -684,4 +684,3 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
return $Text;
}

View File

@ -108,8 +108,10 @@ function html2plain($html, $wraplength = 75, $compact = false)
$message = str_replace("\r", "", $html);
// replace all hashtag addresses
$pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
$message = preg_replace($pattern, '#$2', $message);
if (get_config("system", "remove_hashtags_on_export")) {
$pattern = '/#<a.*?href="(.*?)".*?>(.*?)<\/a>/is';
$message = preg_replace($pattern, '#$2', $message);
}
$doc = new DOMDocument();
$doc->preserveWhiteSpace = false;