From 70dffaacbd0e42c6d67bca24b45fd3125c715e85 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sat, 23 Sep 2006 11:37:05 +0000 Subject: 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/bbcode.php | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'phpBB/includes/bbcode.php') 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
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); -- cgit v1.2.1