aboutsummaryrefslogtreecommitdiffstats
path: root/search.php
diff options
context:
space:
mode:
authorJim Hu <jimhu@users.sourceforge.net>2008-12-26 09:05:15 +0000
committerJim Hu <jimhu@users.sourceforge.net>2008-12-26 09:05:15 +0000
commitfa2ea7e23195bf0791a6695e068980514a3428d4 (patch)
tree293f74e2b2c748a6c143e6cb924fad7356e16742 /search.php
parentb8cc4f61ed18ee4bb8fcedb5a836e7bab9ecbbe4 (diff)
downloadphpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.tar.gz
phpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.tar.bz2
phpicalendar-fa2ea7e23195bf0791a6695e068980514a3428d4.zip
fix bug 961091 with provided patch
Diffstat (limited to 'search.php')
-rw-r--r--search.php14
1 files changed, 7 insertions, 7 deletions
diff --git a/search.php b/search.php
index 288a59a..75a3dd6 100644
--- a/search.php
+++ b/search.php
@@ -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);
}
}

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