diff options
author | Andreas Fischer <bantu@phpbb.com> | 2015-04-28 22:17:51 +0200 |
---|---|---|
committer | Andreas Fischer <bantu@phpbb.com> | 2015-04-28 22:17:51 +0200 |
commit | 39f1e8c009e35caac4e6490e4f94333c8571f57b (patch) | |
tree | b4c07ecef4b82a731982941555da055d344dc60f /phpBB/includes | |
parent | ae2707db1341b8150dbbadde93aa847f15ba3ef2 (diff) | |
parent | 95add752b74bf8c24f88e81799aa0f43341ea90b (diff) | |
download | forums-39f1e8c009e35caac4e6490e4f94333c8571f57b.tar forums-39f1e8c009e35caac4e6490e4f94333c8571f57b.tar.gz forums-39f1e8c009e35caac4e6490e4f94333c8571f57b.tar.bz2 forums-39f1e8c009e35caac4e6490e4f94333c8571f57b.tar.xz forums-39f1e8c009e35caac4e6490e4f94333c8571f57b.zip |
Merge branch '3.1.x'
* 3.1.x:
[ticket/security-180] Use language variable for redirect error in 3.1+
[ticket/security-180] Merge if statement with previous one in 3.1.x
[ticket/security-180] Add tests for redirecting to main URL
[ticket/security-180] Always fail when redirecting to an insecure URL
[ticket/security-180] Make sure that redirect goes to full URL plus slash
[ticket/security-180] Check if redirect URL contains board URL
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/functions.php | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index 76b974d0ce..98b5af372a 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1740,7 +1740,7 @@ function redirect($url, $return = false, $disable_cd_check = false) // Attention: only able to redirect within the same domain if $disable_cd_check is false (yourdomain.com -> www.yourdomain.com will not work) if (!$disable_cd_check && $url_parts['host'] !== $user->host) { - $url = generate_board_url(); + trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } } else if ($url[0] == '/') @@ -1778,7 +1778,7 @@ function redirect($url, $return = false, $disable_cd_check = false) // Clean URL and check if we go outside the forum directory $url = $phpbb_path_helper->clean_url($url); - if (!$disable_cd_check && strpos($url, generate_board_url(true)) === false) + if (!$disable_cd_check && strpos($url, generate_board_url(true) . '/') !== 0) { trigger_error('INSECURE_REDIRECT', E_USER_ERROR); } |