mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #13035: Use ArrayHelper::getValue() in SluggableBehavior::getValue()
This commit is contained in:

committed by
Alexander Makarov

parent
75162652b7
commit
b58fee7d37
@ -9,6 +9,7 @@ namespace yii\behaviors;
|
||||
|
||||
use yii\base\InvalidConfigException;
|
||||
use yii\db\BaseActiveRecord;
|
||||
use yii\helpers\ArrayHelper;
|
||||
use yii\helpers\Inflector;
|
||||
use yii\validators\UniqueValidator;
|
||||
use Yii;
|
||||
@ -139,7 +140,7 @@ class SluggableBehavior extends AttributeBehavior
|
||||
if ($this->isNewSlugNeeded()) {
|
||||
$slugParts = [];
|
||||
foreach ((array) $this->attribute as $attribute) {
|
||||
$slugParts[] = $this->owner->{$attribute};
|
||||
$slugParts[] = ArrayHelper::getValue($this->owner, $attribute);
|
||||
}
|
||||
|
||||
$slug = $this->generateSlug($slugParts);
|
||||
|
Reference in New Issue
Block a user