aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tanghus <thomas@tanghus.net>2012-06-11 15:21:37 +0200
committerThomas Tanghus <thomas@tanghus.net>2012-06-11 15:21:37 +0200
commit2ee809fd8636643c0ccc69bcf023ce2c404143e2 (patch)
tree8c1a171048cb95686442a2913afd97124c9ee850
parent6d9947b3ff7cb3d6d67b538dc3e522fd1f8ccaa1 (diff)
downloadnextcloud-server-2ee809fd8636643c0ccc69bcf023ce2c404143e2.tar.gz
nextcloud-server-2ee809fd8636643c0ccc69bcf023ce2c404143e2.zip
Allow same host redirects (/somepath).
-rwxr-xr-xlib/util.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/util.php b/lib/util.php
index b6f3cb5df44..d1d5983dcfb 100755
--- a/lib/util.php
+++ b/lib/util.php
@@ -332,7 +332,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'));