From 9909e4f125cd32074c8f680529cf96620a4d93d5 Mon Sep 17 00:00:00 2001 From: Jason Oster Date: Wed, 27 May 2009 17:21:01 +0000 Subject: Fix tab/newline parsing --- functions/ical_parser.php | 7 +------ functions/init/sanitize.php | 3 ++- 2 files changed, 3 insertions(+), 7 deletions(-) (limited to 'functions') diff --git a/functions/ical_parser.php b/functions/ical_parser.php index 9baa247..d3031d7 100644 --- a/functions/ical_parser.php +++ b/functions/ical_parser.php @@ -126,6 +126,7 @@ foreach ($cal_filelist as $cal_key=>$filename) { $nextline = ereg_replace("[\r\n]", "", $nextline); } $line = str_replace('\n',"\n",$line); + $line = str_replace('\t',"\t",$line); $line = trim(stripslashes($line)); switch ($line) { case 'BEGIN:VFREEBUSY': @@ -321,9 +322,6 @@ foreach ($cal_filelist as $cal_key=>$filename) { break; case 'SUMMARY': - $data = str_replace("\\n", "
", $data); - $data = str_replace("\\t", " ", $data); - $data = str_replace("\\r", "
", $data); $data = str_replace('$', '$', $data); $data = stripslashes($data); $data = htmlentities(urlencode($data)); @@ -335,9 +333,6 @@ foreach ($cal_filelist as $cal_key=>$filename) { break; case 'DESCRIPTION': - $data = str_replace("\n", "
", $data); - $data = str_replace("\\t", " ", $data); - $data = str_replace("\r", "
", $data); $data = str_replace('$', '$', $data); $data = stripslashes($data); $data = htmlentities(urlencode($data)); diff --git a/functions/init/sanitize.php b/functions/init/sanitize.php index da9fb3f..39b8246 100644 --- a/functions/init/sanitize.php +++ b/functions/init/sanitize.php @@ -60,7 +60,8 @@ function sanitizeForWeb($string) { $string = str_replace('"', '"', $string); $string = str_replace("\n", '
', $string); - + $string = str_replace("\t", '     ', $string); + return $string; } -- cgit v1.2.3