mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/8319] Prepend Board URL to LOCAL_URL links to prevent abuse
The description says: "The URL must be relative to the topic page and cannot contain a server name or protocol." We now enforce this and will add a new token with the current behaviour back. PHPBB3-8319
This commit is contained in:
parent
96b4066368
commit
81140ec887
1 changed files with 9 additions and 1 deletions
|
@ -427,7 +427,15 @@ class acp_bbcodes
|
|||
$fp_replace = str_replace($token, $replace, $fp_replace);
|
||||
|
||||
$sp_match = str_replace(preg_quote($token, '!'), $sp_tokens[$token_type], $sp_match);
|
||||
$sp_replace = str_replace($token, '${' . ($n + 1) . '}', $sp_replace);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
$fp_match = '!' . $fp_match . '!' . $modifiers;
|
||||
|
|
Loading…
Add table
Reference in a new issue