aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarijus <mario@localhost.localdomain>2013-12-13 21:23:10 +0100
committermarijus <mario@localhost.localdomain>2013-12-13 21:23:10 +0100
commited5f725741455f9282a0dc38cd51b07e74b50ab1 (patch)
tree5e3ea7ab417ff06ef015af98440efe2c3ce008b2 /include
parentb994faee9d24a6290e342b6389c56fa7f9ecfac1 (diff)
parent1975fa50da5f418e293e0f018cf1ed2bf0f43930 (diff)
downloadvolse-hubzilla-ed5f725741455f9282a0dc38cd51b07e74b50ab1.tar.gz
volse-hubzilla-ed5f725741455f9282a0dc38cd51b07e74b50ab1.tar.bz2
volse-hubzilla-ed5f725741455f9282a0dc38cd51b07e74b50ab1.zip
Merge branch 'master' of https://github.com/friendica/red
Diffstat (limited to 'include')
-rwxr-xr-xinclude/plugin.php26
1 files changed, 24 insertions, 2 deletions
diff --git a/include/plugin.php b/include/plugin.php
index 5ad467f98..9982a48a2 100755
--- a/include/plugin.php
+++ b/include/plugin.php
@@ -520,10 +520,32 @@ function format_css_if_exists($source) {
$path = theme_include($source[0]);
if($path)
- return '<link rel="stylesheet" href="' . z_root() . '/' . $path . '" type="text/css" media="' . $source[1] . '" />' . "\r\n";
+ return '<link rel="stylesheet" href="' . script_path() . '/' . $path . '" type="text/css" media="' . $source[1] . '" />' . "\r\n";
}
+function script_path() {
+ if(x($_SERVER,'HTTPS') && $_SERVER['HTTPS'])
+ $scheme = 'https';
+ elseif(x($_SERVER,'SERVER_PORT') && (intval($_SERVER['SERVER_PORT']) == 443))
+ $scheme = 'https';
+ else
+ $scheme = 'http';
+
+ if(x($_SERVER,'SERVER_NAME')) {
+ $hostname = $_SERVER['SERVER_NAME'];
+ }
+ else {
+ return z_root();
+ }
+
+ if(x($_SERVER,'SERVER_PORT') && $_SERVER['SERVER_PORT'] != 80 && $_SERVER['SERVER_PORT'] != 443) {
+ $hostname .= ':' . $_SERVER['SERVER_PORT'];
+ }
+
+ return $scheme . '://' . $hostname;
+}
+
function head_add_js($src) {
get_app()->js_sources[] = $src;
}
@@ -552,7 +574,7 @@ function format_js_if_exists($source) {
else
$path = theme_include($source);
if($path)
- return '<script src="' . z_root() . '/' . $path . '" ></script>' . "\r\n" ;
+ return '<script src="' . script_path() . '/' . $path . '" ></script>' . "\r\n" ;
}