BUG Remove usage of deprecated each()

This commit is contained in:
Damian Mooyman 2017-11-01 14:51:14 +13:00
parent a46b5508a9
commit 1bdfd05648
No known key found for this signature in database
GPG Key ID: 78B823A10DE27D1A

View File

@ -203,9 +203,11 @@ class SearchForm extends Form
// Add * to each keyword
$splitWords = preg_split("/ +/", trim($keywords));
$newWords = [];
while (list($i,$word) = each($splitWords)) {
for ($i = 0; $i < count($splitWords); $i++) {
$word = $splitWords[$i];
if ($word[0] == '"') {
while (list($i,$subword) = each($splitWords)) {
while (++$i < count($splitWords)) {
$subword = $splitWords[$i];
$word .= ' ' . $subword;
if (substr($subword, -1) == '"') {
break;