From 0723933c1c79eb3eacb4b3433fdb109208972308 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 19 May 2013 11:08:08 +0200 Subject: [PATCH] removing of hashtag addresses is now hidden behind a configuration --- include/bbcode.php | 3 +-- include/html2plain.php | 6 ++++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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;