mirror of
https://github.com/elyby/accounts.git
synced 2025-05-31 14:11:46 +05:30
Добавлена проверка, что если приходить nil uuid, то бросается IllegalArgumentException для sessionserver
This commit is contained in:
@@ -7,6 +7,8 @@ use yii\validators\Validator;
|
||||
|
||||
class UuidValidator extends Validator {
|
||||
|
||||
public $allowNil = true;
|
||||
|
||||
public $skipOnEmpty = false;
|
||||
|
||||
public $message = '{attribute} must be valid uuid';
|
||||
@@ -18,6 +20,10 @@ class UuidValidator extends Validator {
|
||||
} catch (InvalidArgumentException $e) {
|
||||
$this->addError($model, $attribute, $this->message, []);
|
||||
}
|
||||
|
||||
if (isset($uuid) && $this->allowNil === false && $uuid === Uuid::NIL) {
|
||||
$this->addError($model, $attribute, $this->message, []);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user