From: Michael Vogel Date: Sun, 19 May 2013 09:08:08 +0000 (+0200) Subject: removing of hashtag addresses is now hidden behind a configuration X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=0723933c1c79eb3eacb4b3433fdb109208972308;p=friendica.git removing of hashtag addresses is now hidden behind a configuration --- diff --git a/include/bbcode.php b/include/bbcode.php index 5b676bbadb..3e3345035e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -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>/is'; $Text = preg_replace($pattern, '#$2', $Text); } @@ -684,4 +684,3 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal return $Text; } - diff --git a/include/html2plain.php b/include/html2plain.php index 80768ffff7..677faa9d58 100644 --- a/include/html2plain.php +++ b/include/html2plain.php @@ -108,8 +108,10 @@ function html2plain($html, $wraplength = 75, $compact = false) $message = str_replace("\r", "", $html); // replace all hashtag addresses - $pattern = '/#(.*?)<\/a>/is'; - $message = preg_replace($pattern, '#$2', $message); + if (get_config("system", "remove_hashtags_on_export")) { + $pattern = '/#(.*?)<\/a>/is'; + $message = preg_replace($pattern, '#$2', $message); + } $doc = new DOMDocument(); $doc->preserveWhiteSpace = false;