From 3280427d50b95564c2a21396b5d3bb603795d014 Mon Sep 17 00:00:00 2001 From: Jim Hu Date: Mon, 20 Mar 2006 01:35:56 +0000 Subject: add trailing slashes to calendar_path if needed --- calendars/publish.ical.php | 7 +++++-- calendars/publish.mozilla.php | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'calendars') diff --git a/calendars/publish.ical.php b/calendars/publish.ical.php index 9bb2239..c38dcd6 100644 --- a/calendars/publish.ical.php +++ b/calendars/publish.ical.php @@ -49,8 +49,11 @@ Don't forget to turn off logging when done!! // include PHP iCalendar configuration variables include('../config.inc.php'); -// set calendar path, or just use current directory -$calendar_path = (isset($calendar_path) && $calendar_path != '') ? $calendar_path : ''; +// set calendar path, or just use current directory...make sure there's a trailing slash +if(isset($calendar_path) && $calendar_path != ''){ + if (substr($calendar_path, -1, 1) !='/') $calendar_path = $calendar_path.'/'; +}else{ + $calendar_path = ''; // allow/disallow publishing diff --git a/calendars/publish.mozilla.php b/calendars/publish.mozilla.php index 5910a1c..233b8ed 100644 --- a/calendars/publish.mozilla.php +++ b/calendars/publish.mozilla.php @@ -60,8 +60,11 @@ Don't forget to turn off logging when done!! // include PHP iCalendar configuration variables include('../config.inc.php'); -// set calendar path, or just use current directory -$calendar_path = (isset($calendar_path) && $calendar_path != '') ? $calendar_path : ''; +// set calendar path, or just use current directory...make sure there's a trailing slash +if(isset($calendar_path) && $calendar_path != ''){ + if (substr($calendar_path, -1, 1) !='/') $calendar_path = $calendar_path.'/'; +}else{ + $calendar_path = ''; // allow/disallow publishing -- cgit v1.2.3