diff options
author | Jason Oster <parasytic@users.sourceforge.net> | 2010-05-12 19:30:01 +0000 |
---|---|---|
committer | Jason Oster <parasytic@users.sourceforge.net> | 2010-05-12 19:30:01 +0000 |
commit | 6d2d3830ef59e768198650072c2e8e90f86c20ce (patch) | |
tree | adcee3e815cea930ba300ef083f0b4ea228f5868 /functions/parse | |
parent | 6348756b61737c28dcbb3612db52ea7a5f4da22c (diff) | |
download | phpicalendar-6d2d3830ef59e768198650072c2e8e90f86c20ce.tar.gz phpicalendar-6d2d3830ef59e768198650072c2e8e90f86c20ce.tar.bz2 phpicalendar-6d2d3830ef59e768198650072c2e8e90f86c20ce.zip |
Revert the change that removed parse_tzs.php, and fix it to copy webcals to a local temporary file.
Diffstat (limited to 'functions/parse')
-rw-r--r-- | functions/parse/parse_tzs.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/functions/parse/parse_tzs.php b/functions/parse/parse_tzs.php index 4769d69..2e10834 100644 --- a/functions/parse/parse_tzs.php +++ b/functions/parse/parse_tzs.php @@ -1,5 +1,5 @@ <?php -$ifile = @fopen($filename, "r"); +$ifile = @fopen($filename, 'r'); if ($ifile == FALSE) exit(error($lang['l_error_cantopen'], $filename)); $nextline = fgets($ifile); #if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($lang['l_error_invalidcal'], $filename)); @@ -12,12 +12,12 @@ $is_std = false; while (!feof($ifile)) { $line = $nextline; $nextline = fgets($ifile, 1024); - $nextline = ereg_replace("[\r\n]", "", $nextline); + $nextline = ereg_replace("[\r\n]", '', $nextline); #handle continuation lines that start with either a space or a tab (MS Outlook) - while (isset($nextline{0}) && ($nextline{0} == " " || $nextline{0} == "\t")) { + while (isset($nextline{0}) && ($nextline{0} == ' ' || $nextline{0} == "\t")) { $line = $line . substr($nextline, 1); $nextline = fgets($ifile, 1024); - $nextline = ereg_replace("[\r\n]", "", $nextline); + $nextline = ereg_replace("[\r\n]", '', $nextline); } $line = trim($line); switch ($line) { @@ -56,7 +56,7 @@ while (!feof($ifile)) { break; default: unset ($field, $data, $prop_pos, $property); - if (ereg ("([^:]+):(.*)", $line, $line)){ + if (ereg ('([^:]+):(.*)', $line, $line)){ $field = $line[1]; $data = $line[2]; $property = strtoupper($field); @@ -90,5 +90,6 @@ while (!feof($ifile)) { } } } +fclose($ifile); ?>
\ No newline at end of file |