aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_bbcodes.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/acp/acp_bbcodes.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/acp/acp_bbcodes.php')
-rw-r--r--phpBB/includes/acp/acp_bbcodes.php4
1 files changed, 2 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('/(?<!\\\\)\$([0-9]+)/', $replace, $repad))
{
$repad = $pad + sizeof(array_unique($repad[0]));
- $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\$' . (\$1 + \$pad)", $replace);
+ $replace = preg_replace('/(?<!\\\\)\$([0-9]+)/e', "'\${' . (\$1 + \$pad) . '}'", $replace);
$pad = $repad;
}
@@ -320,7 +320,7 @@ class acp_bbcodes
$fp_replace = str_replace($token, $replace, $fp_replace);
$sp_match = str_replace(preg_quote($token, '!'), '(.*?)', $sp_match);
- $sp_replace = str_replace($token, '$' . ($n + 1), $sp_replace);
+ $sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
}
$fp_match = '!' . $fp_match . '!' . $modifiers;