aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorChad Little <clittle@users.sourceforge.net>2003-02-16 03:40:51 +0000
committerChad Little <clittle@users.sourceforge.net>2003-02-16 03:40:51 +0000
commita14d0600fd164229296e8ab71987f37f9828ab97 (patch)
treeb10aa0414c64e1627d6d7e79ff787bc483f60eff /functions
parentde6812244c7ccb687b537560883019a263765917 (diff)
downloadphpicalendar-a14d0600fd164229296e8ab71987f37f9828ab97.tar.gz
phpicalendar-a14d0600fd164229296e8ab71987f37f9828ab97.tar.bz2
phpicalendar-a14d0600fd164229296e8ab71987f37f9828ab97.zip
Fixed a bug allowing a bad cookie to fail to error page, instead now just loads defualt calendar.
Diffstat (limited to 'functions')
-rw-r--r--functions/init.inc.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php
index e3c42bd..b1e6f65 100644
--- a/functions/init.inc.php
+++ b/functions/init.inc.php
@@ -14,7 +14,7 @@ include(BASE.'functions/error.php');
if ($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 = $phpicalendar['cookie_calendar'];
+ if (isset($phpicalendar['cookie_calendar'])) $default_cal_check = $phpicalendar['cookie_calendar'];
if (isset($phpicalendar['cookie_view'])) $default_view = $phpicalendar['cookie_view'];
if (isset($phpicalendar['cookie_style'])) $style_sheet = $phpicalendar['cookie_style'];
if (isset($phpicalendar['cookie_startday'])) $week_start_day = $phpicalendar['cookie_startday'];
@@ -61,7 +61,13 @@ if (isset($HTTP_GET_VARS['cal']) && $HTTP_GET_VARS['cal'] != '') {
$cal_filename = stripslashes($cal_decoded);
}
} else {
- $cal_filename = $default_cal;
+ $calcheck = $calendar_path.'/'.$default_cal_check.'.ics';
+ $calcheckopen = @fopen($calcheck, "r");
+ if ($calcheckopen == FALSE) {
+ $cal_filename = $default_cal;
+ } else {
+ $cal_filename = $default_cal_check;
+ }
}

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