From 627e2644a2aee478303e63577213329225a39173 Mon Sep 17 00:00:00 2001 From: Nils Adermann Date: Sun, 17 Jul 2011 00:44:39 -0400 Subject: [ticket/8937] Keep space characters in front of [code] bbcode content PHPBB3-8937 --- phpBB/includes/bbcode.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php index d77bb3c4a7..9356e3e9b4 100644 --- a/phpBB/includes/bbcode.php +++ b/phpBB/includes/bbcode.php @@ -584,6 +584,13 @@ class bbcode $code = str_replace("\t", '   ', $code); $code = str_replace(' ', '  ', $code); $code = str_replace(' ', '  ', $code); + $code = str_replace("\n ", "\n ", $code); + + // keep space at the beginning + if (!empty($code) && $code[0] == ' ') + { + $code = ' ' . substr($code, 1); + } // remove newline at the beginning if (!empty($code) && $code[0] == "\n") -- cgit v1.2.1