summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-03-31 10:50:05 +0200
committerVincent Petry <pvince81@owncloud.com>2014-03-31 10:50:05 +0200
commit65e3f634000a2142f412b85d0443f241bb64a9ab (patch)
tree649d54976620281180a3d89988c67538890e9ace
parent5b552c84daed2f2dff60a6df26dfdb49bb4b94aa (diff)
parent7278f2f5673ca3ebc62938f854cb1028bb5bcfef (diff)
downloadnextcloud-server-65e3f634000a2142f412b85d0443f241bb64a9ab.tar.gz
nextcloud-server-65e3f634000a2142f412b85d0443f241bb64a9ab.zip
Merge pull request #7939 from owncloud/wring_redirect_on_login
Use UrlGenerator in OC\Util::redirectToDefaultPage(). Fix #7936
-rw-r--r--lib/private/helper.php3
-rwxr-xr-xlib/private/util.php9
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 98a86388d20..d7ac0b5f4fa 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -78,8 +78,7 @@ class OC_Helper {
* Returns a absolute url to the given app and file.
*/
public static function linkToAbsolute($app, $file, $args = array()) {
- $urlLinkTo = self::linkTo($app, $file, $args);
- return self::makeURLAbsolute($urlLinkTo);
+ return self::linkTo($app, $file, $args);
}
/**
diff --git a/lib/private/util.php b/lib/private/util.php
index c48a5505d41..731b7c97503 100755
--- a/lib/private/util.php
+++ b/lib/private/util.php
@@ -701,17 +701,18 @@ class OC_Util {
* @return void
*/
public static function redirectToDefaultPage() {
+ $urlGenerator = \OC::$server->getURLGenerator();
if(isset($_REQUEST['redirect_url'])) {
- $location = OC_Helper::makeURLAbsolute(urldecode($_REQUEST['redirect_url']));
+ $location = urldecode($_REQUEST['redirect_url']);
}
else if (isset(OC::$REQUESTEDAPP) && !empty(OC::$REQUESTEDAPP)) {
- $location = OC_Helper::linkToAbsolute( OC::$REQUESTEDAPP, 'index.php' );
+ $location = $urlGenerator->getAbsoluteURL('/index.php/apps/'.OC::$REQUESTEDAPP.'/index.php');
} else {
$defaultPage = OC_Appconfig::getValue('core', 'defaultpage');
if ($defaultPage) {
- $location = OC_Helper::makeURLAbsolute(OC::$WEBROOT.'/'.$defaultPage);
+ $location = $urlGenerator->getAbsoluteURL($defaultPage);
} else {
- $location = OC_Helper::linkToAbsolute( 'files', 'index.php' );
+ $location = $urlGenerator->getAbsoluteURL('/index.php/files/index.php');
}
}
OC_Log::write('core', 'redirectToDefaultPage: '.$location, OC_Log::DEBUG);