aboutsummaryrefslogtreecommitdiffstats
path: root/functions
diff options
context:
space:
mode:
authorjwangen <jwangen>2002-11-07 03:41:02 +0000
committerjwangen <jwangen>2002-11-07 03:41:02 +0000
commitc5c3a7e645ae5f22309313f2a20ebb8b37fcd13e (patch)
tree32acca25b1040542687a7b7ab5ffeeb2fd727045 /functions
parenta711a87096acb611c5ebd1cebbe69abfc1699e79 (diff)
downloadphpicalendar-c5c3a7e645ae5f22309313f2a20ebb8b37fcd13e.tar.gz
phpicalendar-c5c3a7e645ae5f22309313f2a20ebb8b37fcd13e.tar.bz2
phpicalendar-c5c3a7e645ae5f22309313f2a20ebb8b37fcd13e.zip
Minor modifications to parser, took out more regex where it wasn't needed
Diffstat (limited to 'functions')
-rw-r--r--functions/ical_parser.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/functions/ical_parser.php b/functions/ical_parser.php
index 288751b..3a245bb 100644
--- a/functions/ical_parser.php
+++ b/functions/ical_parser.php
@@ -56,7 +56,7 @@ if ($parse_file) {
$ifile = fopen($filename, "r");
if ($ifile == FALSE) exit(error($error_invalidcal_lang, $filename));
$nextline = fgets($ifile, 1024);
- if (!preg_match("/^BEGIN:VCALENDAR/i", $nextline)) exit(error($error_invalidcal_lang, $filename));
+ if (trim($nextline) != 'BEGIN:VCALENDAR') exit(error($error_invalidcal_lang, $filename));
// Set a value so we can check to make sure $master_array contains valid data
$master_array['-1'] = 'valid cal file';
@@ -84,7 +84,7 @@ if ($parse_file) {
$nextline = ereg_replace("[\r\n]", "", $nextline);
}
$line = trim($line);
- if (stristr($line, 'BEGIN:VEVENT')) {
+ if ($line == 'BEGIN:VEVENT') {
// each of these vars were being set to an empty string
unset (
$start_time, $end_time, $start_date, $end_date, $summary,
@@ -106,7 +106,7 @@ if ($parse_file) {
$interval, $number
);
- } elseif (stristr($line, 'END:VEVENT')) {
+ } elseif ($line == 'END:VEVENT') {
// make sure we have some value for $uid
if (!isset($uid)) {
$uid = $uid_counter;
@@ -466,9 +466,9 @@ if ($parse_file) {
- } elseif (stristr($line, "BEGIN:VALARM")) {
+ } elseif ($line == 'BEGIN:VALARM') {
$valarm_set = TRUE;
- } elseif (stristr($line, "END:VALARM")) {
+ } elseif ($line == 'END:VALARM') {
$valarm_set = FALSE;
} else {

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