From 956548beab93780c028f79ce0c75d06093306f19 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Mon, 14 Aug 2006 07:07:46 +0000 Subject: fix for Bug 1466026 adjust subscribe and download paths --- functions/init.inc.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'functions/init.inc.php') 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; } } } -- cgit v1.2.3