Sanitize redirect urls
This commit is contained in:
parent
7dcf38c40f
commit
051442bc76
|
@ -115,6 +115,6 @@ elseif(OC_User::isLoggedIn()) {
|
|||
if(is_null(OC::$REQUESTEDFILE)){
|
||||
$sectoken=rand(1000000,9999999);
|
||||
$_SESSION['sectoken']=$sectoken;
|
||||
OC_Template::printGuestPage('', 'login', array('error' => $error, 'sectoken' => $sectoken, 'redirect' => isset($_REQUEST['redirect_url'])?strip_tags($_REQUEST['redirect_url']):'' ));
|
||||
OC_Template::printGuestPage('', 'login', array('error' => $error, 'sectoken' => $sectoken, 'redirect' => isset($_REQUEST['redirect_url'])?htmlentities($_REQUEST['redirect_url']):'' ));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -312,7 +312,7 @@ class OC_Util {
|
|||
*/
|
||||
public static function redirectToDefaultPage(){
|
||||
if(isset($_REQUEST['redirect_url'])) {
|
||||
header( 'Location: '.$_REQUEST['redirect_url']);
|
||||
header( 'Location: '.htmlentities($_REQUEST['redirect_url']));
|
||||
} else {
|
||||
header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files'));
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue