mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Used substr_compare instead of substr when we don't care about result
This commit is contained in:
@ -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']);
|
||||
|
Reference in New Issue
Block a user