]> source.dussan.org Git - nextcloud-server.git/commitdiff
Allow same host redirects (/somepath).
authorThomas Tanghus <thomas@tanghus.net>
Mon, 11 Jun 2012 13:21:37 +0000 (15:21 +0200)
committerThomas Tanghus <thomas@tanghus.net>
Wed, 13 Jun 2012 16:32:07 +0000 (18:32 +0200)
lib/util.php

index 6be3e755722def64f19b02a0ea236d6d9bb98faf..49f658f3c0e908d3a335683738f5d6ff244a2d91 100644 (file)
@@ -323,7 +323,8 @@ class OC_Util {
        * Redirect to the user default page
        */
        public static function redirectToDefaultPage(){
-               if(isset($_REQUEST['redirect_url']) && substr($_REQUEST['redirect_url'], 0, strlen(OC::$WEBROOT)) == OC::$WEBROOT) {
+               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 {
                        header( 'Location: '.OC::$WEBROOT.'/'.OC_Appconfig::getValue('core', 'defaultpage', '?app=files'));