From 885937b49a44efec4da0d054400357da3066ac9e Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 24 Nov 2020 19:29:12 +0200 Subject: [PATCH 1/5] [6.x] update changelog --- CHANGELOG-6.x.md | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 9c8471465064..ae564658b926 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,16 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.4...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.5...6.x) + + +## [v6.20.5 (2020-11-24)](https://github.com/laravel/framework/compare/v6.20.4...v6.20.5) + +### Fixed +- Fixing BroadcastException message in PusherBroadcaster@broadcast ([#35290](https://github.com/laravel/framework/pull/35290)) +- Fixed generic DetectsLostConnection string ([#35323](https://github.com/laravel/framework/pull/35323)) + +### Changed +- Updated `aws/aws-sdk-php` suggest to `^3.155` ([#35267](https://github.com/laravel/framework/pull/35267)) ## [v6.20.4 (2020-11-17)](https://github.com/laravel/framework/compare/v6.20.3...v6.20.4) From b5064d731a47dca3d7bd31f7a4eff5617aa5c2b9 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 26 Nov 2020 15:21:02 +0100 Subject: [PATCH 2/5] Backport Redis context option (#35370) --- src/Illuminate/Redis/Connectors/PhpRedisConnector.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php index b01f114205d8..5a1ef9117bf3 100644 --- a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php +++ b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php @@ -128,6 +128,10 @@ protected function establishConnection($client, array $config) $parameters[] = Arr::get($config, 'read_timeout', 0.0); } + if (version_compare(phpversion('redis'), '5.3.0', '>=')) { + $parameters[] = Arr::get($config, 'context'); + } + $client->{($persistent ? 'pconnect' : 'connect')}(...$parameters); } @@ -152,6 +156,10 @@ protected function createRedisClusterInstance(array $servers, array $options) $parameters[] = $options['password'] ?? null; } + if (version_compare(phpversion('redis'), '5.3.2', '>=')) { + $parameters[] = Arr::get($options, 'context'); + } + return tap(new RedisCluster(...$parameters), function ($client) use ($options) { if (! empty($options['prefix'])) { $client->setOption(RedisCluster::OPT_PREFIX, $options['prefix']); From a93d6a5d31f57a352c10d78b8b7625e49de25187 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Fri, 27 Nov 2020 16:37:52 +0100 Subject: [PATCH 3/5] [6.x] Enable Redis in CI (#35390) * Add extensions * Do not add null for Redis connect --- .github/workflows/tests.yml | 8 ++++---- src/Illuminate/Redis/Connectors/PhpRedisConnector.php | 8 ++++++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02cdf62a88dd..f64afb62a99a 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,8 +8,8 @@ on: jobs: linux_tests: - runs-on: ubuntu-latest + services: mysql: image: mysql:5.7 @@ -40,7 +40,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd + extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, gd, redis, memcached tools: composer:v2 coverage: none @@ -72,8 +72,8 @@ jobs: DB_USERNAME: root windows_tests: - runs-on: windows-latest + strategy: fail-fast: true matrix: @@ -95,7 +95,7 @@ jobs: uses: shivammathur/setup-php@v2 with: php-version: ${{ matrix.php }} - extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp + extensions: dom, curl, libxml, mbstring, zip, pdo, sqlite, pdo_sqlite, gd, pdo_mysql, fileinfo, ftp, redis, memcached tools: composer:v2 coverage: none diff --git a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php index 5a1ef9117bf3..684737b135fe 100644 --- a/src/Illuminate/Redis/Connectors/PhpRedisConnector.php +++ b/src/Illuminate/Redis/Connectors/PhpRedisConnector.php @@ -129,7 +129,9 @@ protected function establishConnection($client, array $config) } if (version_compare(phpversion('redis'), '5.3.0', '>=')) { - $parameters[] = Arr::get($config, 'context'); + if (! is_null($context = Arr::get($config, 'context'))) { + $parameters[] = $context; + } } $client->{($persistent ? 'pconnect' : 'connect')}(...$parameters); @@ -157,7 +159,9 @@ protected function createRedisClusterInstance(array $servers, array $options) } if (version_compare(phpversion('redis'), '5.3.2', '>=')) { - $parameters[] = Arr::get($options, 'context'); + if (! is_null($context = Arr::get($options, 'context'))) { + $parameters[] = $context; + } } return tap(new RedisCluster(...$parameters), function ($client) use ($options) { From fff077c1f84169302b31fe812d132b62666ade07 Mon Sep 17 00:00:00 2001 From: NEGits <33746490+NEGits@users.noreply.github.com> Date: Mon, 30 Nov 2020 15:14:20 +0100 Subject: [PATCH 4/5] [6.x] Fix validating image/jpeg images after Symfony/Mime update (#35419) * [6.x] Fix validating image/jpeg images after Symfony/Mime update Symfony/Mime v5.20 changed the returned extension for an image with image/jpeg mime type: symfony/mime@aa1d922. This commit adds `.jpg`, which fixes the validation. * [6.x] Add test for image validation with jpg extension --- src/Illuminate/Validation/Concerns/ValidatesAttributes.php | 2 +- tests/Validation/ValidationValidatorTest.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index bc340ddebf72..6f566ce09f37 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1054,7 +1054,7 @@ public function validateLte($attribute, $value, $parameters) */ public function validateImage($attribute, $value) { - return $this->validateMimes($attribute, $value, ['jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']); + return $this->validateMimes($attribute, $value, ['jpg', 'jpeg', 'png', 'gif', 'bmp', 'svg', 'webp']); } /** diff --git a/tests/Validation/ValidationValidatorTest.php b/tests/Validation/ValidationValidatorTest.php index d9a02a78389e..3a968b894c02 100755 --- a/tests/Validation/ValidationValidatorTest.php +++ b/tests/Validation/ValidationValidatorTest.php @@ -2703,6 +2703,12 @@ public function testValidateImage() $file7->expects($this->any())->method('getClientOriginalExtension')->willReturn('webp'); $v = new Validator($trans, ['x' => $file7], ['x' => 'Image']); $this->assertTrue($v->passes()); + + $file2 = $this->getMockBuilder(UploadedFile::class)->setMethods(['guessExtension', 'getClientOriginalExtension'])->setConstructorArgs($uploadedFile)->getMock(); + $file2->expects($this->any())->method('guessExtension')->willReturn('jpg'); + $file2->expects($this->any())->method('getClientOriginalExtension')->willReturn('jpg'); + $v = new Validator($trans, ['x' => $file2], ['x' => 'Image']); + $this->assertTrue($v->passes()); } public function testValidateImageDoesNotAllowPhpExtensionsOnImageMime() From e0b93cf3ef527fca52e3f83fee50c629feab4da3 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 1 Dec 2020 09:01:00 -0600 Subject: [PATCH 5/5] version --- src/Illuminate/Foundation/Application.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Foundation/Application.php b/src/Illuminate/Foundation/Application.php index a0c436f2d2e3..9632e9b31b64 100755 --- a/src/Illuminate/Foundation/Application.php +++ b/src/Illuminate/Foundation/Application.php @@ -31,7 +31,7 @@ class Application extends Container implements ApplicationContract, HttpKernelIn * * @var string */ - const VERSION = '6.20.5'; + const VERSION = '6.20.6'; /** * The base path for the Laravel installation.