aboutsummaryrefslogtreecommitdiffstats
path: root/include/bbcode.php
diff options
context:
space:
mode:
authorThomas Willingham <beardyunixer@beardyunixer.com>2014-06-22 18:00:23 +0100
committerThomas Willingham <beardyunixer@beardyunixer.com>2014-06-22 18:00:23 +0100
commit388872949ed0de4cf036e546fafb3f4b4bd04fee (patch)
tree2fcefc5c8f2398166b8e7003033fe160cb3325fc /include/bbcode.php
parentb47ff712deafdb8617599b0af4403b9563c9be93 (diff)
parent301c7cdb89b13c4fc7c502795f121e13c1f9441d (diff)
downloadvolse-hubzilla-388872949ed0de4cf036e546fafb3f4b4bd04fee.tar.gz
volse-hubzilla-388872949ed0de4cf036e546fafb3f4b4bd04fee.tar.bz2
volse-hubzilla-388872949ed0de4cf036e546fafb3f4b4bd04fee.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include/bbcode.php')
-rw-r--r--include/bbcode.php12
1 files changed, 9 insertions, 3 deletions
diff --git a/include/bbcode.php b/include/bbcode.php
index 674b5f45a..60463fc00 100644
--- a/include/bbcode.php
+++ b/include/bbcode.php
@@ -344,9 +344,15 @@ function bbcode($Text,$preserve_nl = false, $tryoembed = true) {
$a = get_app();
- // Move all spaces out of the tags
- $Text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $Text);
- $Text = preg_replace("/(\s*)\[\/(\w*)\]/ism", '[/$2]$1', $Text);
+ // Move all spaces out of the tags
+ // ....Uhm why?
+ // This is basically doing a trim() on the stuff in between tags, but it messes up
+ // carefully crafted bbcode and especially other pre-formatted code.
+ // Commenting out until we come up with a use case where it's needed. Then let's try and
+ // special case rather than a heavy-handed approach like this.
+
+// $Text = preg_replace("/\[(\w*)\](\s*)/ism", '$2[$1]', $Text);
+// $Text = preg_replace("/(\s*)\[\/(\w*)\]/ism", '[/$2]$1', $Text);
// Hide all [noparse] contained bbtags by spacefying them
if (strpos($Text,'[noparse]') !== false) {