diff --git a/lib/helper.php b/lib/helper.php index 2c221ddf19..a52adc9695 100644 --- a/lib/helper.php +++ b/lib/helper.php @@ -100,6 +100,17 @@ class OC_Helper { return OC_Request::serverProtocol(). '://' . OC_Request::serverHost() . $url; } + /** + * @brief Creates an url for remote use + * @param string $service id + * @return string the url + * + * Returns a url to the given service. + */ + public static function linkToRemoteBase( $service ) { + return self::linkTo( '', 'remote.php') . '/' . $service; + } + /** * @brief Creates an absolute url for remote use * @param string $service id @@ -108,7 +119,7 @@ class OC_Helper { * Returns a absolute url to the given service. */ public static function linkToRemote( $service, $add_slash = true ) { - return self::linkToAbsolute( '', 'remote.php') . '/' . $service . (($add_slash && $service[strlen($service)-1]!='/')?'/':''); + return self::makeURLAbsolute(self::linkToRemoteBase($service)) . (($add_slash && $service[strlen($service)-1]!='/')?'/':''); } /** diff --git a/lib/templatelayout.php b/lib/templatelayout.php index 4f26775b48..78893457f4 100644 --- a/lib/templatelayout.php +++ b/lib/templatelayout.php @@ -49,7 +49,7 @@ class OC_TemplateLayout extends OC_Template { $jsfiles = self::findJavascriptFiles(OC_Util::$scripts); $this->assign('jsfiles', array(), false); if (!empty(OC_Util::$core_scripts)) { - $this->append( 'jsfiles', OC_Helper::linkToRemote('core.js', false)); + $this->append( 'jsfiles', OC_Helper::linkToRemoteBase('core.js', false)); } foreach($jsfiles as $info) { $root = $info[0]; @@ -62,7 +62,7 @@ class OC_TemplateLayout extends OC_Template { $cssfiles = self::findStylesheetFiles(OC_Util::$styles); $this->assign('cssfiles', array()); if (!empty(OC_Util::$core_styles)) { - $this->append( 'cssfiles', OC_Helper::linkToRemote('core.css', false)); + $this->append( 'cssfiles', OC_Helper::linkToRemoteBase('core.css', false)); } foreach($cssfiles as $info) { $root = $info[0];