mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
PHP 5.3 compatibility in array syntax and use strict comparison operators
This commit is contained in:
parent
af99004549
commit
31ee3eb0f3
@ -180,14 +180,14 @@ class SearchForm extends Form {
|
|||||||
}
|
}
|
||||||
// Add * to each keyword
|
// Add * to each keyword
|
||||||
$splitWords = preg_split("/ +/", trim($keywords));
|
$splitWords = preg_split("/ +/", trim($keywords));
|
||||||
$newWords = [];
|
$newWords = array();
|
||||||
for ($i = 0; $i < count($splitWords); $i++) {
|
for ($i = 0; $i < count($splitWords); $i++) {
|
||||||
$word = $splitWords[$i];
|
$word = $splitWords[$i];
|
||||||
if ($word[0] == '"') {
|
if ($word[0] === '"') {
|
||||||
while (++$i < count($splitWords)) {
|
while (++$i < count($splitWords)) {
|
||||||
$subword = $splitWords[$i];
|
$subword = $splitWords[$i];
|
||||||
$word .= ' ' . $subword;
|
$word .= ' ' . $subword;
|
||||||
if (substr($subword, -1) == '"') {
|
if (substr($subword, -1) === '"') {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user