Skip to content

Commit 28a880b

Browse files
committed
Use array_key_exists in validator.
1 parent 23bdbd0 commit 28a880b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

laravel/validator.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ protected function validate_same($attribute, $value, $parameters)
317317
{
318318
$other = $parameters[0];
319319

320-
return isset($this->attributes[$other]) and $value == $this->attributes[$other];
320+
return array_key_exists($other, $this->attributes) and $value == $this->attributes[$other];
321321
}
322322

323323
/**
@@ -332,7 +332,7 @@ protected function validate_different($attribute, $value, $parameters)
332332
{
333333
$other = $parameters[0];
334334

335-
return isset($this->attributes[$other]) and $value != $this->attributes[$other];
335+
return array_key_exists($other, $this->attributes) and $value != $this->attributes[$other];
336336
}
337337

338338
/**

0 commit comments

Comments
 (0)