BBCode: Newlines under attachments are now removed

This commit is contained in:
Michael Vogel 2014-11-02 17:35:49 +01:00
parent a818ed2d49
commit 14ea4b972e
1 changed files with 4 additions and 6 deletions

View File

@ -825,9 +825,6 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
// Rearrange shares to attachments
$Text = preg_replace_callback("((.*?)\[class=(.*?)\](.*?)\[\/class\])ism", "bb_rearrange_share",$Text);
// Handle attached links or videos
$Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed);
// Rearrange shared links
// if (get_config("system", "rearrange_shared_links") AND (!$simplehtml OR $tryoembed))
// $Text = preg_replace_callback("(\[class=(.*?)\](.*?)\[\/class\])ism","bb_rearrange_link",$Text);
@ -848,8 +845,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
// removing multiplicated newlines
if (get_config("system", "remove_multiplicated_lines")) {
$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ");
$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ");
$search = array("\n\n\n", "\n ", " \n", "[/quote]\n\n", "\n[/quote]", "[/li]\n", "\n[li]", "\n[ul]", "[/ul]\n", "\n\n[share ", "[/attachment]\n");
$replace = array("\n\n", "\n", "\n", "[/quote]\n", "[/quote]", "[/li]", "[li]", "[ul]", "[/ul]", "\n[share ", "[/attachment]");
do {
$oldtext = $Text;
$Text = str_replace($search, $replace, $Text);
@ -861,7 +858,8 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true, $simplehtml = fal
if($preserve_nl)
$Text = str_replace(array("\n","\r"), array('',''),$Text);
// Handle attached links or videos
$Text = bb_attachment($Text, ($simplehtml != 4) AND ($simplehtml != 0), $tryoembed);
// Set up the parameters for a URL search string
$URLSearchString = "^\[\]";