diff --git a/lib/util.php b/lib/util.php index 46c9e0ef92..7792f96d44 100755 --- a/lib/util.php +++ b/lib/util.php @@ -324,7 +324,11 @@ class OC_Util { 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] == '/')) { 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')); } exit();