mirror of
https://github.com/yiisoft/yii2.git
synced 2026-03-19 05:37:54 +01:00
Fix #19462: Fix validator client options to encode HTML tags
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
namespace yii\validators;
|
||||
|
||||
use Yii;
|
||||
use yii\helpers\Json;
|
||||
use yii\web\UploadedFile;
|
||||
|
||||
/**
|
||||
@@ -166,7 +167,7 @@ class ImageValidator extends FileValidator
|
||||
{
|
||||
ValidationAsset::register($view);
|
||||
$options = $this->getClientOptions($model, $attribute);
|
||||
return 'yii.validation.image(attribute, messages, ' . json_encode($options, JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_UNICODE) . ', deferred);';
|
||||
return 'yii.validation.image(attribute, messages, ' . Json::htmlEncode($options) . ', deferred);';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user