aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 11c9ea88c1..e6d973c7f3 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -533,6 +533,15 @@ function bbencode_second_pass_code($text, $uid, $bbcode_tpl)
$after_replace = $matches[1][$i];
$after_replace = preg_replace($html_entities_match, $html_entities_replace, $after_replace);
+
+ // Replace all spaces with non-breaking spaces.
+ $after_replace = str_replace(" ", " ", $after_replace);
+
+ // Replace 3 nbsp's with "   " so non-tabbed code indents without making huge long lines.
+ $after_replace = str_replace("   ", "   ", $after_replace);
+
+ // Replace tabs with "   " so tabbed code indents sorta right without making huge long lines.
+ $after_replace = str_replace("\t", "   ", $after_replace);
$str_to_match = "[code:1:$uid]" . $before_replace . "[/code:1:$uid]";