aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/bbcode.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-09-23 11:37:05 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-09-23 11:37:05 +0000
commit70dffaacbd0e42c6d67bca24b45fd3125c715e85 (patch)
treeeb2324d54345b90a166c3876b040a10c55f8f78e /phpBB/includes/bbcode.php
parentd62e93ee30ad69f627e9ef9ba586caecf1ed7106 (diff)
downloadforums-70dffaacbd0e42c6d67bca24b45fd3125c715e85.tar
forums-70dffaacbd0e42c6d67bca24b45fd3125c715e85.tar.gz
forums-70dffaacbd0e42c6d67bca24b45fd3125c715e85.tar.bz2
forums-70dffaacbd0e42c6d67bca24b45fd3125c715e85.tar.xz
forums-70dffaacbd0e42c6d67bca24b45fd3125c715e85.zip
fix custom bbcode html replacement to correctly replace references
It failed if there was a number directly after the token, resulting in $12345, where $1 was needed. Fixed by using ${x} also made sure that newlines within the html replacement are not replaced with <br />. git-svn-id: file:///svn/phpbb/trunk@6391 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/bbcode.php')
-rw-r--r--phpBB/includes/bbcode.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/phpBB/includes/bbcode.php b/phpBB/includes/bbcode.php
index 7293f07dc9..7af99e4b57 100644
--- a/phpBB/includes/bbcode.php
+++ b/phpBB/includes/bbcode.php
@@ -155,6 +155,12 @@ class bbcode
while ($row = $db->sql_fetchrow($result))
{
+ // To circumvent replacing newlines with <br /> for the generated html,
+ // we just remove newlines here. We do not do this within the admin panel to
+ // let the admin lay out his html code nicely
+ $row['bbcode_tpl'] = str_replace(array("\n", "\r"), '', $row['bbcode_tpl']);
+ $row['second_pass_replace'] = str_replace(array("\n", "\r"), '', $row['second_pass_replace']);
+
$rowset[$row['bbcode_id']] = $row;
}
$db->sql_freeresult($result);