aboutsummaryrefslogtreecommitdiffstats
path: root/calendars
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2006-04-05 04:49:15 +0000
committerJim Hu <jimhu@users.sourceforge.net>2006-04-05 04:49:15 +0000
commit2c4e40eabfd7bd82ba4ceb1952770f72824616e7 (patch)
tree821e9d2bc18dea6bc36fe0175879cb422575e970 /calendars
parent91f74617b9451ae7b64399d19e88da8f0f828f4e (diff)
downloadphpicalendar-2c4e40eabfd7bd82ba4ceb1952770f72824616e7.tar.gz
phpicalendar-2c4e40eabfd7bd82ba4ceb1952770f72824616e7.tar.bz2
phpicalendar-2c4e40eabfd7bd82ba4ceb1952770f72824616e7.zip
bug fix for publish scripts
Diffstat (limited to 'calendars')
-rw-r--r--calendars/publish.ical.php31
-rw-r--r--calendars/publish.mozilla.php2
2 files changed, 11 insertions, 22 deletions
diff --git a/calendars/publish.ical.php b/calendars/publish.ical.php
index c38dcd6..249a757 100644
--- a/calendars/publish.ical.php
+++ b/calendars/publish.ical.php
@@ -54,7 +54,7 @@ if(isset($calendar_path) && $calendar_path != ''){
if (substr($calendar_path, -1, 1) !='/') $calendar_path = $calendar_path.'/';
}else{
$calendar_path = '';
-
+}
// allow/disallow publishing
$phpicalendar_publishing = isset($phpicalendar_publishing) ? $phpicalendar_publishing : 0;
@@ -94,33 +94,25 @@ if(PHPICALENDAR_PUBLISHING == 1)
}
// publishing
- if($_SERVER['REQUEST_METHOD'] == 'PUT')
- {
+ if($_SERVER['REQUEST_METHOD'] == 'PUT'){
// get calendar data
- if($fp = fopen('php://input','r'))
- {
- while(!@feof($fp))
- {
+ if($fp = fopen('php://input','r')){
+ while(!@feof($fp)){
$data .= fgets($fp,4096);
}
@fclose($fp);
- }
- else
- {
+ }else{
logmsg('unable to read input data');
}
- if(isset($data))
- {
+ if(isset($data)){
// get calendar name
$cal_arr = explode("\n",$data);
- foreach($cal_arr as $k => $v)
- {
- if(strstr($v,'X-WR-CALNAME:'))
- {
+ foreach($cal_arr as $k => $v){
+ if(strstr($v,'X-WR-CALNAME:')){
$arr = explode(':',$v);
$calendar_name = trim($arr[1]);
break;
@@ -130,13 +122,10 @@ if(PHPICALENDAR_PUBLISHING == 1)
$calendar_name = isset($calendar_name) ? $calendar_name : 'default';
// write to file
- if($fp = fopen($calendar_path.$calendar_name.'.ics','w+'))
- {
+ if($fp = fopen($calendar_path.$calendar_name.'.ics','w+')){
fputs($fp, $data, strlen($data) );
@fclose($fp);
- }
- else
- {
+ }else{
logmsg( 'couldnt open file '.$calendar_path.$calendar_name.'.ics' );
}
}
diff --git a/calendars/publish.mozilla.php b/calendars/publish.mozilla.php
index 233b8ed..7d4e9ed 100644
--- a/calendars/publish.mozilla.php
+++ b/calendars/publish.mozilla.php
@@ -65,7 +65,7 @@ if(isset($calendar_path) && $calendar_path != ''){
if (substr($calendar_path, -1, 1) !='/') $calendar_path = $calendar_path.'/';
}else{
$calendar_path = '';
-
+}
// allow/disallow publishing
$phpicalendar_publishing = isset($phpicalendar_publishing) ? $phpicalendar_publishing : 0;

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