aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-05-29 06:27:14 +0000
committerChad Little <clittle@users.sourceforge.net>2003-05-29 06:27:14 +0000
commit572e8a6a1f9dbc8e2a7ac0dc480689487b4217aa (patch)
tree26a63e35f8477a44fb541598877f8166fe7fd1c2 /functions
parentaa4bae7e1a095471174d42d79628ed72fa7ce901 (diff)
downloadphpicalendar-572e8a6a1f9dbc8e2a7ac0dc480689487b4217aa.tar.gz
phpicalendar-572e8a6a1f9dbc8e2a7ac0dc480689487b4217aa.tar.bz2
phpicalendar-572e8a6a1f9dbc8e2a7ac0dc480689487b4217aa.zip
Fixed a tons of E_ALL errors for smoother installs.
Diffstat (limited to 'functions')
-rw-r--r--functions/date_functions.php20
-rw-r--r--functions/ical_parser.php44
-rw-r--r--functions/init.inc.php4
3 files changed, 44 insertions, 24 deletions
diff --git a/functions/date_functions.php b/functions/date_functions.php
index e8abe2c..cc13518 100644
--- a/functions/date_functions.php
+++ b/functions/date_functions.php
@@ -170,17 +170,25 @@ function openevent($cal, $st, $end, $arr, $lines, $wrap, $clic, $fclic) {
$ev = $arr["event_text"];
$event_text = strip_tags($event_text, '<b><i><u>');
}
- if ($arr["organizer"]) {
+ if (isset($arr["organizer"])) {
$organizer = urlencode(addslashes($arr["organizer"]));
+ } else {
+ $organizer = '';
}
- if ($arr["attendee"]) {
+ if (isset($arr["attendee"])) {
$attendee = urlencode(addslashes($arr["attendee"]));
+ } else {
+ $attendee = '';
}
- if ($arr["location"]) {
- $organizer = $arr["location"];
+ if (isset($arr["location"])) {
+ $location = $arr["location"];
+ } else {
+ $location = '';
}
- if ($arr["status"]) {
- $organizer = $arr["status"];
+ if (isset($arr["status"])) {
+ $status = $arr["status"];
+ } else {
+ $status = '';
}
if ($event_text != "") {
if ($lines) $event_text = word_wrap($event_text, $wrap, $lines);
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 2c193b4..1ccdde5 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -94,11 +94,11 @@ if ($parse_file) {
$recurrence_id, $uid, $class, $attendee, $location, $organizer
);
- $except_dates = array();
- $except_times = array();
+ $except_dates = array();
+ $except_times = array();
$first_duration = TRUE;
- $count = 1000000;
- $valarm_set = FALSE;
+ $count = 1000000;
+ $valarm_set = FALSE;
unset(
$until, $bymonth, $byday, $bymonthday, $byweek, $byweekno,
@@ -109,13 +109,15 @@ if ($parse_file) {
} elseif ($line == 'END:VEVENT') {
// CLASS support
- if ($class == 'PRIVATE') {
- $summary ='**PRIVATE**';
- $description ='**PRIVATE**';
- } elseif ($class == 'CONFIDENTIAL') {
- $summary ='**CONFIDENTIAL**';
- $description ='**CONFIDENTIAL**';
- }
+ if (isset($class)) {
+ if ($class == 'PRIVATE') {
+ $summary ='**PRIVATE**';
+ $description ='**PRIVATE**';
+ } elseif ($class == 'CONFIDENTIAL') {
+ $summary ='**CONFIDENTIAL**';
+ $description ='**CONFIDENTIAL**';
+ }
+ }
// make sure we have some value for $uid
if (!isset($uid)) {
@@ -145,8 +147,11 @@ if ($parse_file) {
$write_processed = true;
}
- if (!isset($summary)) $summary = '';
- if (!isset($description)) $description = '';
+ if (!isset($summary)) $summary = '';
+ if (!isset($description)) $description = '';
+ if (!isset($status)) $status = '';
+ if (!isset($class)) $class = '';
+ if (!isset($location)) $location = '';
$mArray_begin = mktime (0,0,0,12,21,($this_year - 1));
$mArray_end = mktime (0,0,0,1,12,($this_year + 1));
@@ -179,13 +184,16 @@ if ($parse_file) {
}
// RECURRENCE-ID Support
- if ($recurrence_d) {
+ if (isset($recurrence_d)) {
+
$recurrence_delete["$recurrence_d"]["$recurrence_t"] = $uid;
}
// handle single changes in recurring events
// Maybe this is no longer need since done at bottom of parser? - CL 11/20/02
if ($uid_valid && $write_processed) {
+ if (!isset($hour)) $hour = 00;
+ if (!isset($minute)) $minute = 00;
$processed[$uid] = array($start_date,($hour.$minute));
}
@@ -908,7 +916,9 @@ if ($parse_file) {
}
}
}
-//print '<pre>';
+
+ /*
+ //print '<pre>';
// Remove pesky recurrences
if (is_array($recurrence_delete)) {
foreach ($recurrence_delete as $delete => $delete_key) {
@@ -943,7 +953,9 @@ if ($parse_file) {
}
}
}
- }
+ }
+
+ */
// Sort the array by absolute date.
if (isset($master_array) && is_array($master_array)) {
ksort($master_array);
diff --git a/functions/init.inc.php b/functions/init.inc.php
index 2b44e69..05326f8 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -6,12 +6,12 @@
//chmod(BASE.'calendars/School.ics',0666);
// uncomment when developing, comment for shipping version
-// error_reporting (E_ALL);
+error_reporting (E_ALL);
if (!defined('BASE')) define('BASE', './');
include(BASE.'config.inc.php');
include(BASE.'functions/error.php');
-if ($HTTP_COOKIE_VARS['phpicalendar']) {
+if (isset($HTTP_COOKIE_VARS['phpicalendar'])) {
$phpicalendar = unserialize(stripslashes($HTTP_COOKIE_VARS['phpicalendar']));
if (isset($phpicalendar['cookie_language'])) $language = $phpicalendar['cookie_language'];
if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar'];

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