Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
rizqyhi committed Jan 22, 2025
1 parent 8083a9f commit add193d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Validation/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1204,7 +1204,7 @@ protected function validateActiveUrl($attribute, $value)
*/
protected function validateImage($attribute, $value)
{
return $this->validateMimes($attribute, $value, array('jpeg', 'png', 'gif', 'bmp'));
return $this->validateMimes($attribute, $value, array('jpg', 'jpeg', 'png', 'gif', 'bmp'));
}

/**
Expand Down
6 changes: 6 additions & 0 deletions tests/Validation/ValidationValidatorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -1010,6 +1010,12 @@ public function testValidateImage()
$file5->expects($this->any())->method('guessExtension')->willReturn('png');
$v->setFiles(['x' => $file5]);
$this->assertTrue($v->passes());

$file6 = $this->getMock(UploadedFile::class, ['guessExtension', 'getClientOriginalExtension'], $uploadedFile);
$file6->expects($this->any())->method('guessExtension')->willReturn('jpg');
$file6->expects($this->any())->method('getClientOriginalExtension')->willReturn('jpg');
$v->setFiles(['x' => $file6]);
$this->assertTrue($v->passes());
}


Expand Down

0 comments on commit add193d

Please sign in to comment.