aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
authorOleg Pudeyev <oleg@bsdpower.com>2011-08-07 16:30:32 -0400
committerOleg Pudeyev <oleg@bsdpower.com>2011-08-07 16:30:32 -0400
commite81c7a788af7abb8053c5b83d94a83e08fdf5c06 (patch)
tree523c84ee4c6526ed354a4b32fad4ae3885d015d7 /phpBB/includes/bbcode.php
parent88eb822126fd15c08794d6e3fb760d854c824475 (diff)
parenteb4660f4ef455d3ce6b5a24db2dae52ddc095133 (diff)
downloadforums-e81c7a788af7abb8053c5b83d94a83e08fdf5c06.tar
forums-e81c7a788af7abb8053c5b83d94a83e08fdf5c06.tar.gz
forums-e81c7a788af7abb8053c5b83d94a83e08fdf5c06.tar.bz2
forums-e81c7a788af7abb8053c5b83d94a83e08fdf5c06.tar.xz
forums-e81c7a788af7abb8053c5b83d94a83e08fdf5c06.zip
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/8937] Keep space characters in front of [code] bbcode content
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index a360bcd5d1..4d064a838b 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -584,6 +584,13 @@ class bbcode
$code = str_replace("\t", '&nbsp; &nbsp;', $code);
$code = str_replace(' ', '&nbsp; ', $code);
$code = str_replace(' ', ' &nbsp;', $code);
+ $code = str_replace("\n ", "\n&nbsp;", $code);
+
+ // keep space at the beginning
+ if (!empty($code) && $code[0] == ' ')
+ {
+ $code = '&nbsp;' . substr($code, 1);
+ }
// remove newline at the beginning
if (!empty($code) && $code[0] == "\n")