Use array_key_exists in validator.
This commit is contained in:
parent
23bdbd0834
commit
28a880b5b5
|
@ -317,7 +317,7 @@ protected function validate_same($attribute, $value, $parameters)
|
||||||
{
|
{
|
||||||
$other = $parameters[0];
|
$other = $parameters[0];
|
||||||
|
|
||||||
return isset($this->attributes[$other]) and $value == $this->attributes[$other];
|
return array_key_exists($other, $this->attributes) and $value == $this->attributes[$other];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -332,7 +332,7 @@ protected function validate_different($attribute, $value, $parameters)
|
||||||
{
|
{
|
||||||
$other = $parameters[0];
|
$other = $parameters[0];
|
||||||
|
|
||||||
return isset($this->attributes[$other]) and $value != $this->attributes[$other];
|
return array_key_exists($other, $this->attributes) and $value != $this->attributes[$other];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue