Use strpos in place of substr
This commit is contained in:
parent
9864d9572d
commit
8a0bcfbed2
@ -162,10 +162,8 @@ class DialogHelper extends Helper
|
|||||||
$ofs = 0;
|
$ofs = 0;
|
||||||
|
|
||||||
foreach ($autocomplete as $value) {
|
foreach ($autocomplete as $value) {
|
||||||
// Get a substring of the current autocomplete item based on number of chars typed (e.g. AcmeDemoBundle = Acme)
|
// If typed characters match the beginning chunk of value (e.g. [AcmeDe]moBundle)
|
||||||
$matchTest = substr($value, 0, $i);
|
if (0 === strpos($value, $ret) && $i !== strlen($value)) {
|
||||||
|
|
||||||
if ($ret === $matchTest && $i !== strlen($value)) {
|
|
||||||
$matches[$numMatches++] = $value;
|
$matches[$numMatches++] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user