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
e86ac130a5
commit
ad5c2d41b4
@ -180,14 +180,14 @@ class SearchForm extends Form {
|
||||
}
|
||||
// Add * to each keyword
|
||||
$splitWords = preg_split("/ +/", trim($keywords));
|
||||
$newWords = [];
|
||||
$newWords = array();
|
||||
for ($i = 0; $i < count($splitWords); $i++) {
|
||||
$word = $splitWords[$i];
|
||||
if ($word[0] == '"') {
|
||||
if ($word[0] === '"') {
|
||||
while (++$i < count($splitWords)) {
|
||||
$subword = $splitWords[$i];
|
||||
$word .= ' ' . $subword;
|
||||
if (substr($subword, -1) == '"') {
|
||||
if (substr($subword, -1) === '"') {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user