summaryrefslogtreecommitdiffstats
path: root/lib/private/helper.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-05-07 14:40:59 +0200
committerVincent Petry <pvince81@owncloud.com>2014-05-07 14:40:59 +0200
commit75d81eefc1e70fca0cd72202e5eaede254df94e3 (patch)
treed175f5f24bb3220dfb83e7abf7ac2e3b22131752 /lib/private/helper.php
parenta8c83f79efdd1639895c4a7edee2893b0aff776d (diff)
parentdf9d9ac958da9e61e069bd7c1be5350551bdb36b (diff)
downloadnextcloud-server-75d81eefc1e70fca0cd72202e5eaede254df94e3.tar.gz
nextcloud-server-75d81eefc1e70fca0cd72202e5eaede254df94e3.zip
Merge pull request #8223 from owncloud/fix_linkToPublic
Fix linkToPublic and linkToAbsolute.
Diffstat (limited to 'lib/private/helper.php')
-rw-r--r--lib/private/helper.php18
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/private/helper.php b/lib/private/helper.php
index 4058ec199a7..64da1f6fb12 100644
--- a/lib/private/helper.php
+++ b/lib/private/helper.php
@@ -78,7 +78,9 @@ class OC_Helper {
* Returns a absolute url to the given app and file.
*/
public static function linkToAbsolute($app, $file, $args = array()) {
- return self::linkTo($app, $file, $args);
+ return OC::$server->getURLGenerator()->getAbsoluteURL(
+ self::linkTo($app, $file, $args)
+ );
}
/**
@@ -112,8 +114,10 @@ class OC_Helper {
* Returns a absolute url to the given service.
*/
public static function linkToRemote($service, $add_slash = true) {
- return self::makeURLAbsolute(self::linkToRemoteBase($service))
- . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
+ return OC::$server->getURLGenerator()->getAbsoluteURL(
+ self::linkToRemoteBase($service)
+ . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '')
+ );
}
/**
@@ -125,8 +129,12 @@ class OC_Helper {
* Returns a absolute url to the given service.
*/
public static function linkToPublic($service, $add_slash = false) {
- return self::linkToAbsolute('', 'public.php') . '?service=' . $service
- . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : '');
+ return OC::$server->getURLGenerator()->getAbsoluteURL(
+ self::linkTo(
+ '', 'public.php') . '?service=' . $service
+ . (($add_slash && $service[strlen($service) - 1] != '/') ? '/' : ''
+ )
+ );
}
/**