diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2005-11-16 01:09:36 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2005-11-16 01:09:36 +0000 |
commit | f331dd43763f98f809a4d33520140bd86e9c3766 (patch) | |
tree | 95b9b0d21d6640d5f8e017ae6c053d9afd79fc7f /functions/init.inc.php | |
parent | b1891233a2bf73b74913fb23df5869ed54c29027 (diff) | |
download | phpicalendar-f331dd43763f98f809a4d33520140bd86e9c3766.tar.gz phpicalendar-f331dd43763f98f809a4d33520140bd86e9c3766.tar.bz2 phpicalendar-f331dd43763f98f809a4d33520140bd86e9c3766.zip |
bug fixes to handle cpath better
Diffstat (limited to 'functions/init.inc.php')
-rw-r--r-- | functions/init.inc.php | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/functions/init.inc.php b/functions/init.inc.php index 2cec049..ac3141e 100644 --- a/functions/init.inc.php +++ b/functions/init.inc.php @@ -15,6 +15,12 @@ $ALL_CALENDARS_COMBINED = 'all_calendars_combined971'; if (!defined('BASE')) define('BASE', './'); include_once(BASE.'config.inc.php'); include_once(BASE.'error.php'); +if($_REQUEST['cpath']){ + $cpath = $_REQUEST['cpath']; + $calendar_path .= "/$cpath"; + $tmp_dir .= "/$cpath"; +} + include_once(BASE.'functions/calendar_functions.php'); include_once(BASE.'functions/userauth_functions.php'); if (isset($_COOKIE['phpicalendar'])) { @@ -69,11 +75,7 @@ if (ini_get('max_execution_time') < 60) { @ini_set('max_execution_time', '60'); } -if($_REQUEST['cpath']){ - $cpath = $_REQUEST['cpath']; - $calendar_path .= "/$cpath"; - $tmp_dir .= "/$cpath"; -} + if ($calendar_path == '') { $calendar_path = BASE.'calendars'; @@ -85,14 +87,13 @@ if (isset($_GET['cal'])) { if(stristr($_GET['cal'], ",")) { $_GET['cal'] = explode(",", $_GET['cal']); } - //if we have an array of calendard, decode each (though I'm not sure this is necessary) + //if we have an array of calendars, decode each (though I'm not sure this is necessary) if(is_array($_GET['cal'])) { $cal_filename = array(); foreach($_GET['cal'] as $c) { $cal_filename[] = urldecode($c); } - } - else { + }else { $cal_filename = urldecode($_GET['cal']); } } else { |