aboutsummaryrefslogtreecommitdiffstats
path: root/functions/init.inc.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-08-14 07:07:46 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-08-14 07:07:46 +0000
commit956548beab93780c028f79ce0c75d06093306f19 (patch)
treea9f9f45dc0fa57965bae0381139197a0272e0955 /functions/init.inc.php
parent64e5a82e3d2f7796c238a6782031eeb9d8093680 (diff)
downloadphpicalendar-956548beab93780c028f79ce0c75d06093306f19.tar.gz
phpicalendar-956548beab93780c028f79ce0c75d06093306f19.tar.bz2
phpicalendar-956548beab93780c028f79ce0c75d06093306f19.zip
fix for Bug 1466026 adjust subscribe and download paths
Diffstat (limited to 'functions/init.inc.php')
-rw-r--r--functions/init.inc.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 1a1cdae..83b540e 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -214,16 +214,19 @@ if (count($local_cals) > 0) {
// only one calendar being displayed and those paths are defined.
if (count($local_cals) == 1) {
$filename = $local_cals[0];
+ $add_cpath = '';
+ if (isset($cpath) && $cpath !='') $add_cpath = "$cpath/";
+
if (($download_uri == '') && (preg_match('/(^\/|\.\.\/)/', $filename) == 0)) {
- $subscribe_path = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'."$cpath/".$filename;
+ $subscribe_path = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'.$filename;
$download_filename = $filename;
} elseif ($download_uri != '') {
$newurl = eregi_replace("^(http://)", "", $download_uri);
- $subscribe_path = 'webcal://'.$newurl.'/'."$cpath/".basename($filename);
- $download_filename = $download_uri.'/'."$cpath/".basename($filename);
+ $subscribe_path = 'webcal://'.$newurl.'/'.$add_cpath.basename($filename);
+ $download_filename = $download_uri.'/'.$add_cpath.basename($filename);
} else {
- $subscribe_path = "$cpath/";
- $download_filename = "$cpath/";
+ $subscribe_path = $add_cpath;
+ $download_filename = $add_cpath;
}
}
}

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