Fixes #16266: Fixed yii\helpers\BaseStringHelper where explode would not allow 0 as trim string

This commit is contained in:
Thoulah
2018-05-13 00:14:39 +02:00
committed by Alexander Makarov
parent e4b559d720
commit a32cfcc8ef
3 changed files with 3 additions and 1 deletions

View File

@ -269,7 +269,7 @@ class BaseStringHelper
public static function explode($string, $delimiter = ',', $trim = true, $skipEmpty = false)
{
$result = explode($delimiter, $string);
if ($trim) {
if ($trim !== false) {
if ($trim === true) {
$trim = 'trim';
} elseif (!is_callable($trim)) {