Update of /cvsroot/phpicalendar/phpicalendar/functions
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18721/phpicalendar/functions
Modified Files:
init.inc.php
Log Message:
fix for Bug 1466026 adjust subscribe and download paths
Index: init.inc.php
===================================================================
RCS file: /cvsroot/phpicalendar/phpicalendar/functions/init.inc.php,v
retrieving revision 1.101
retrieving revision 1.102
diff -C2 -d -r1.101 -r1.102
*** init.inc.php 14 Aug 2006 06:29:14 -0000 1.101
--- init.inc.php 14 Aug 2006 07:07:46 -0000 1.102
***************
*** 215,228 ****
if (count($local_cals) == 1) {
$filename = $local_cals[0];
if (($download_uri == '') && (preg_match('/(^\/|\.\.\/)/', $filename) == 0)) {
! $subscribe_path = 'webcal://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['PHP_SELF']).'/'."$cpath/".$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);
} else {
! $subscribe_path = "$cpath/";
! $download_filename = "$cpath/";
}
}
--- 215,231 ----
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']).'/'.$filename;
$download_filename = $filename;
} elseif ($download_uri != '') {
$newurl = eregi_replace("^(http://)", "", $download_uri);
! $subscribe_path = 'webcal://'.$newurl.'/'.$add_cpath.basename($filename);
! $download_filename = $download_uri.'/'.$add_cpath.basename($filename);
} else {
! $subscribe_path = $add_cpath;
! $download_filename = $add_cpath;
}
}
|