From 70dffaacbd0e42c6d67bca24b45fd3125c715e85 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Sep 2006 11:37:05 +0000 Subject: [PATCH] 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
. git-svn-id: file:///svn/phpbb/trunk@6391 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/acp/acp_bbcodes.php | 4 ++-- phpBB/includes/bbcode.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index f37d9b1aef..e0c04528cf 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -290,7 +290,7 @@ class acp_bbcodes if (preg_match_all('/(?sql_fetchrow($result)) { + // To circumvent replacing newlines with
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);