Used substr_compare instead of substr when we don't care about result

This commit is contained in:
Alexander Makarov
2014-07-23 16:37:49 +04:00
parent 5c767e5d34
commit 07f01bcf2b
14 changed files with 21 additions and 21 deletions

View File

@ -803,7 +803,7 @@ class BaseHtml
$options['name'] = $name;
if (isset($options['unselect'])) {
// add a hidden field so that if the list box has no option being selected, it still submits a value
if (substr($name, -2) === '[]') {
if (substr_compare($name, '[]', -2) === 0) {
$name = substr($name, 0, -2);
}
$hidden = static::hiddenInput($name, $options['unselect']);