From 29f5270313b067e9cc1ce83ccfb79c4cb7b91d0c Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 14 Feb 2018 20:28:10 -0500 Subject: [PATCH] Remove unused parameter preserve_nl in BBCode::convert --- include/bbcode.php | 2 +- src/Content/Text/BBCode.php | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index ab211e554..0bda691ac 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -7,5 +7,5 @@ use Friendica\Content\Text\BBCode; function bbcode($Text, $preserve_nl = false, $tryoembed = true, $simplehtml = false, $forplaintext = false) { - return BBCode::convert($Text, $preserve_nl, $tryoembed, $simplehtml, $forplaintext); + return BBCode::convert($Text, $tryoembed, $simplehtml, $forplaintext); } diff --git a/src/Content/Text/BBCode.php b/src/Content/Text/BBCode.php index 71daa1d14..a81b69e34 100644 --- a/src/Content/Text/BBCode.php +++ b/src/Content/Text/BBCode.php @@ -1342,13 +1342,12 @@ class BBCode * - 8: Used for WP backlink text setting * * @param string $text - * @param bool $preserve_nl * @param bool $try_oembed * @param int $simple_html * @param bool $for_plaintext * @return string */ - public static function convert($text, $preserve_nl = false, $try_oembed = true, $simple_html = false, $for_plaintext = false) + public static function convert($text, $try_oembed = true, $simple_html = false, $for_plaintext = false) { $a = get_app(); @@ -1473,10 +1472,6 @@ class BBCode $text = str_replace(["\r","\n"], ['
', '
'], $text); - if ($preserve_nl) { - $text = str_replace(["\n", "\r"], ['', ''], $text); - } - // Remove all hashtag addresses if ((!$try_oembed || $simple_html) && !in_array($simple_html, [3, 7])) { $text = preg_replace("/([#@!])\[url\=([$URLSearchString]*)\](.*?)\[\/url\]/ism", '$1$3', $text);