aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2009-01-26 03:51:52 +0000
committerJim Hu <jimhu@users.sourceforge.net>2009-01-26 03:51:52 +0000
commit46a025425efdd8f196d17465308f108d8f01992f (patch)
treece44185de16517170067d763f858699d389180b9
parent9c1ad1c80dbdf3cfa73477437c33fb821a0424b8 (diff)
downloadphpicalendar-46a025425efdd8f196d17465308f108d8f01992f.zip
phpicalendar-46a025425efdd8f196d17465308f108d8f01992f.tar.gz
phpicalendar-46a025425efdd8f196d17465308f108d8f01992f.tar.bz2
fix multiline descriptions
-rw-r--r--calendars/test.ics3
-rw-r--r--functions/ical_parser.php5
-rw-r--r--includes/event.php2
3 files changed, 7 insertions, 3 deletions
diff --git a/calendars/test.ics b/calendars/test.ics
index 30e6720..2cc1e32 100644
--- a/calendars/test.ics
+++ b/calendars/test.ics
@@ -102,6 +102,9 @@ SEQUENCE:7
UID:starts on 07
DTSTAMP:20020918T224617Z
SUMMARY:Earlier overlap
+DESCRIPTION:this is a test
+ multiline
+ description
STATUS:CONFIRMED
DURATION:P3D
DTSTART;TZID=US/Eastern:20081207
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 3776e55..ad4ed81 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -125,6 +125,7 @@ foreach ($cal_filelist as $cal_key=>$filename) {
$nextline = fgets($ifile, 1024);
$nextline = ereg_replace("[\r\n]", "", $nextline);
}
+ $line = str_replace('\n',"\n",$line);
$line = trim(stripslashes($line));
switch ($line) {
case 'BEGIN:VFREEBUSY':
@@ -333,9 +334,9 @@ foreach ($cal_filelist as $cal_key=>$filename) {
break;
case 'DESCRIPTION':
- $data = str_replace("\\n", "<br />", $data);
+ $data = str_replace("\n", "<br />", $data);
$data = str_replace("\\t", "&nbsp;", $data);
- $data = str_replace("\\r", "<br />", $data);
+ $data = str_replace("\r", "<br />", $data);
$data = str_replace('$', '&#36;', $data);
$data = stripslashes($data);
$data = htmlentities(urlencode($data));
diff --git a/includes/event.php b/includes/event.php
index c250e8d..150a0e4 100644
--- a/includes/event.php
+++ b/includes/event.php
@@ -108,7 +108,7 @@ $page->replace_tags(array(
'cal' => $event['calname'],
'event_text' => $event['event_text'],
'event_times' => $event_times,
- 'description' => nl2br($event['description']),
+ 'description' => str_replace('\n',"<br />",$event['description']),
'organizer' => $organizer,
'attendee' => $attendee,
'status' => $event['status'],

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