diff options
author | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-26 09:05:15 +0000 |
---|---|---|
committer | Jim Hu <jimhu@users.sourceforge.net> | 2008-12-26 09:05:15 +0000 |
commit | fa2ea7e23195bf0791a6695e068980514a3428d4 (patch) | |
tree | 293f74e2b2c748a6c143e6cb924fad7356e16742 | |
parent | b8cc4f61ed18ee4bb8fcedb5a836e7bab9ecbbe4 (diff) | |
download | phpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.tar.gz phpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.tar.bz2 phpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.zip |
fix bug 961091 with provided patch
-rw-r--r-- | calendars/test.ics | 15 | ||||
-rw-r--r-- | search.php | 14 |
2 files changed, 22 insertions, 7 deletions
diff --git a/calendars/test.ics b/calendars/test.ics index 1b92d29..ecfe9f3 100644 --- a/calendars/test.ics +++ b/calendars/test.ics @@ -49,5 +49,20 @@ DTSTART;TZID=US/Eastern:20100902T090000 RRULE:FREQ=DAILY;COUNT=10
END:VEVENT
+BEGIN:VEVENT
+DTSTAMP:20070306T130934Z
+ORGANIZER;CN=xxx:MAILTO:xxx localhost localdomain
+CREATED:20070212T152028Z
+UID:KOrganizer-1162820691.683
+SEQUENCE:2
+LAST-MODIFIED:20070306T130835Z
+SUMMARY:Knitting Class
+CLASS:PUBLIC
+PRIORITY:5
+RRULE:FREQ=WEEKLY;UNTIL=20070326T190000Z;BYDAY=MO
+DTSTART:20070219T190000Z
+DTEND:20070219T210000Z
+TRANSP:OPAQUE
+END:VEVENT
END:VCALENDAR
@@ -109,12 +109,12 @@ function format_search($search_str) { if ($i != 0 && $and_arr[$i] == 'or') { while ($and_arr[$i] == 'or') { $or_arr[$j][] = $and_arr[$i-1]; - unset($and_arr[$i], $and_arr[$i-1]); - $i += 2; + array_splice($and_arr,$i-1,2); + $i--; } - if (isset($and_arr[$i-1])) { - $or_arr[$j][] = $and_arr[$i-1]; - unset($and_arr[$i-1]); + if (isset($and_arr[$i])) { + $or_arr[$j][] = $and_arr[$i]; + array_splice($and_arr,$i,1); } $or_str_arr[$j] = implode('</b> OR <b>', $or_arr[$j]); $j++; @@ -125,10 +125,10 @@ function format_search($search_str) { foreach($and_arr as $key => $val) { if (substr($val,0,1) == '-') { $not_arr[] = substr($val,1); - unset($and_arr[$key]); + array_splice($and_arr,$key,1); } elseif(substr($val,0,1) == '+') { $and_arr[] = substr($val,1); - unset($and_arr[$key]); + array_splice($and_arr,$key,1); } } |