Prefer requested app before redirecting to default page

This commit is contained in:
Bart Visscher 2012-06-20 17:10:17 +02:00
parent 6404476bec
commit 7a3d606cac
1 changed files with 5 additions and 1 deletions

View File

@ -324,7 +324,11 @@ class OC_Util {
OC_Log::write('core','redirectToDefaultPage',OC_Log::DEBUG); OC_Log::write('core','redirectToDefaultPage',OC_Log::DEBUG);
if(isset($_REQUEST['redirect_url']) && (substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT || $_REQUEST['redirect_url'][0] == '/')) { if(isset($_REQUEST['redirect_url']) && (substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT || $_REQUEST['redirect_url'][0] == '/')) {
header( 'Location: '.$_REQUEST['redirect_url']); header( 'Location: '.$_REQUEST['redirect_url']);
} else { }
else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
header( 'Location: '.OC::$WEBROOT.'/?app='.OC::$REQUESTEDAPP );
}
else {
header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files')); header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files'));
} }
exit(); exit();