Skip to content

Commit

Permalink
[ticket/8319] Do not repeat the replacement
Browse files Browse the repository at this point in the history
PHPBB3-8319
  • Loading branch information
nickvergessen committed Jul 10, 2013
1 parent 6206d4a commit 9210d73
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions phpBB/includes/acp/acp_bbcodes.php
Expand Up @@ -431,15 +431,11 @@ function build_regexp(&$bbcode_match, &$bbcode_tpl)
$fp_replace = str_replace($token, $replace, $fp_replace);

$sp_match = str_replace(preg_quote($token, '!'), $sp_tokens[$token_type], $sp_match);
if ($token_type === 'LOCAL_URL')
{
// Prepend the board url to local relative links
$sp_replace = str_replace($token, generate_board_url() . '/' . '${' . ($n + 1) . '}', $sp_replace);
}
else
{
$sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
}

// Prepend the board url to local relative links
$replace_prepend = ($token_type === 'LOCAL_URL') ? generate_board_url() . '/' : '';

$sp_replace = str_replace($token, $replace_prepend . '${' . ($n + 1) . '}', $sp_replace);
}

$fp_match = '!' . $fp_match . '!' . $modifiers;
Expand Down

0 comments on commit 9210d73

Please sign in to comment.