diff options
author | Bart Visscher <bartv@thisnet.nl> | 2012-08-06 22:15:55 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2012-08-07 20:43:00 +0200 |
commit | c4f1a1de5b5f9dda969a3b3872eea5628d8ef9e2 (patch) | |
tree | 39daafb3d1af62ea6d08059a0c1c53d45d96eeb8 /lib/helper.php | |
parent | 6d0390dccaa02af0c5144733bf9c3e254e77fa9a (diff) | |
download | nextcloud-server-c4f1a1de5b5f9dda969a3b3872eea5628d8ef9e2.tar.gz nextcloud-server-c4f1a1de5b5f9dda969a3b3872eea5628d8ef9e2.zip |
Added function to make url absolute
Diffstat (limited to 'lib/helper.php')
-rw-r--r-- | lib/helper.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/helper.php b/lib/helper.php index 666bc6badfc..c404f6e5440 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -120,8 +120,19 @@ class OC_Helper { */ public static function linkToAbsolute( $app, $file ) { $urlLinkTo = self::linkTo( $app, $file ); - $urlLinkTo = self::serverProtocol(). '://' . self::serverHost() . $urlLinkTo; - return $urlLinkTo; + return self::makeURLAbsolute($urlLinkTo); + } + + /** + * @brief Makes an $url absolute + * @param $url the url + * @returns the absolute url + * + * Returns a absolute url to the given app and file. + */ + public static function makeURLAbsolute( $url ) + { + return self::serverProtocol(). '://' . self::serverHost() . $url; } /** |