mirror of
https://github.com/yiisoft/yii2.git
synced 2025-11-14 21:30:17 +08:00
@@ -11,6 +11,7 @@ Yii Framework 2 Change Log
|
||||
- Bug #3042: `yii\widgets\Pjax` should end application right after it finishes responding to a pjax request (qiangxue)
|
||||
- Bug #3066: `yii\db\mssql\Schema::getTableSchema()` should return null when the table does not exist (qiangxue)
|
||||
- Bug #3091: Fixed inconsistent treatment of `Widget::run()` when a widget is used as a container and as a self-contained object (qiangxue)
|
||||
- Bug #3118: Ensure client validation has the same behavior as server side validation for number validator (cebe)
|
||||
- Bug #3121: `yii\base\Application::bootstrap` may fail to load some components if they are specified as class names (qiangxue)
|
||||
- Bug #3125: `yii\console\controllers\AssetController` now respects data URL resources (klimov-paul)
|
||||
- Bug #3128: Fixed the bug that `defaultRoles` set in RBAC manager was not working as specified (qiangxue)
|
||||
|
||||
@@ -128,14 +128,18 @@ class NumberValidator extends Validator
|
||||
];
|
||||
|
||||
if ($this->min !== null) {
|
||||
$options['min'] = $this->min;
|
||||
// ensure numeric value to make javascript comparison equal to PHP comparison
|
||||
// https://github.com/yiisoft/yii2/issues/3118
|
||||
$options['min'] = is_string($this->min) ? (float)$this->min : $this->min;
|
||||
$options['tooSmall'] = Yii::$app->getI18n()->format($this->tooSmall, [
|
||||
'attribute' => $label,
|
||||
'min' => $this->min,
|
||||
], Yii::$app->language);
|
||||
}
|
||||
if ($this->max !== null) {
|
||||
$options['max'] = $this->max;
|
||||
// ensure numeric value to make javascript comparison equal to PHP comparison
|
||||
// https://github.com/yiisoft/yii2/issues/3118
|
||||
$options['max'] = is_string($this->max) ? (float)$this->max : $this->max;
|
||||
$options['tooBig'] = Yii::$app->getI18n()->format($this->tooBig, [
|
||||
'attribute' => $label,
|
||||
'max' => $this->max,
|
||||
|
||||
Reference in New Issue
Block a user