aboutsummaryrefslogtreecommitdiffstats
path: root/functions/init
diff options
context:
space:
mode:
authorJason Oster <parasytic@users.sourceforge.net>2009-02-05 15:31:03 +0000
committerJason Oster <parasytic@users.sourceforge.net>2009-02-05 15:31:03 +0000
commit360e2501d58ea518d7de230cc4718e8754f550ee (patch)
treeb5a19a8d62c753166fe8a0133fd984181514954c /functions/init
parent460e2d62ad46f6948dd7c1ec4d0fd22e94f3a153 (diff)
downloadphpicalendar-360e2501d58ea518d7de230cc4718e8754f550ee.tar.gz
phpicalendar-360e2501d58ea518d7de230cc4718e8754f550ee.tar.bz2
phpicalendar-360e2501d58ea518d7de230cc4718e8754f550ee.zip
Fix CSS and RSS links when the server uses HTTPS or non-standard port: Patch #2511351
Diffstat (limited to 'functions/init')
-rw-r--r--functions/init/cpaths.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/functions/init/cpaths.php b/functions/init/cpaths.php
index e728654..b73d3be 100644
--- a/functions/init/cpaths.php
+++ b/functions/init/cpaths.php
@@ -1,7 +1,8 @@
<?php
# adjust paths in case they are incorrect
if ($phpiCal_config->default_path == '') {
- $p = str_replace("/rss","","http://".$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']) );
+ $proto = (!empty($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off') ? 'https://' : 'http://');
+ $p = str_replace("/rss","",$proto.$_SERVER['SERVER_NAME'].':'.$_SERVER['SERVER_PORT'].dirname($_SERVER['PHP_SELF']) );
$phpiCal_config->setProperty('default_path', $p);
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy