mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-31 14:00:31 +02:00
#i66
git-svn-id: file:///svn/phpbb/trunk@8114 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
@@ -1816,6 +1816,15 @@ function redirect($url, $return = false)
|
||||
trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
// Now, also check the protocol and for a valid url the last time...
|
||||
$allowed_protocols = array('http', 'https', 'ftp', 'ftps');
|
||||
$url_parts = parse_url($url);
|
||||
|
||||
if ($url_parts === false || empty($url_parts['scheme']) || !in_array($url_parts['scheme'], $allowed_protocols))
|
||||
{
|
||||
trigger_error('Tried to redirect to potentially insecure url.', E_USER_ERROR);
|
||||
}
|
||||
|
||||
if ($return)
|
||||
{
|
||||
return $url;
|
||||
|
Reference in New Issue
Block a user