Skip to content

Commit f64299a

Browse files
committed
fix conflicts
2 parents ca658c3 + 0fc3711 commit f64299a

File tree

4 files changed

+10
-2
lines changed

4 files changed

+10
-2
lines changed

src/Illuminate/Foundation/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class Application extends Container implements ApplicationContract, CachesConfig
3333
*
3434
* @var string
3535
*/
36-
const VERSION = '7.25.0';
36+
const VERSION = '7.26.0';
3737

3838
/**
3939
* The base path for the Laravel installation.

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ protected function failsRatioCheck($parameters, $width, $height)
563563
[1, 1], array_filter(sscanf($parameters['ratio'], '%f/%d'))
564564
);
565565

566-
$precision = 1 / max($width, $height);
566+
$precision = 1 / (max($width, $height) + 1);
567567

568568
return abs($numerator / $denominator - $width / $height) > $precision;
569569
}

tests/Validation/ValidationValidatorTest.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2896,6 +2896,14 @@ public function testValidateImageDimensions()
28962896

28972897
$v = new Validator($trans, ['x' => $svgFile], ['x' => 'dimensions:max_width=1,max_height=1']);
28982898
$this->assertTrue($v->passes());
2899+
2900+
// Knowing that demo image4.png has width = 64 and height = 65
2901+
$uploadedFile = new UploadedFile(__DIR__.'/fixtures/image4.png', '', null, null, true);
2902+
$trans = $this->getIlluminateArrayTranslator();
2903+
2904+
// Ensure validation doesn't erroneously fail when ratio doesn't matches
2905+
$v = new Validator($trans, ['x' => $uploadedFile], ['x' => 'dimensions:ratio=1']);
2906+
$this->assertFalse($v->passes());
28992907
}
29002908

29012909
/**

tests/Validation/fixtures/image4.png

1.73 KB
Loading

0 commit comments

Comments
 (0)