mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[ticket/security-180] Merge if statement with previous one in 3.1.x
SECURITY-180
This commit is contained in:
parent
89723b17d9
commit
ec207d0a71
1 changed files with 1 additions and 7 deletions
|
@ -2347,15 +2347,9 @@ function redirect($url, $return = false, $disable_cd_check = false)
|
||||||
// Clean URL and check if we go outside the forum directory
|
// Clean URL and check if we go outside the forum directory
|
||||||
$url = $phpbb_path_helper->clean_url($url);
|
$url = $phpbb_path_helper->clean_url($url);
|
||||||
|
|
||||||
if (!$disable_cd_check && strpos($url, generate_board_url(true)) === false)
|
|
||||||
{
|
|
||||||
trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make sure we don't redirect to external URLs
|
|
||||||
if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0)
|
if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0)
|
||||||
{
|
{
|
||||||
trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
|
trigger_error('INSECURE_REDIRECT', E_USER_ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
|
// Make sure no linebreaks are there... to prevent http response splitting for PHP < 4.4.2
|
||||||
|
|
Loading…
Add table
Reference in a new issue