From 3d95575f4688e53e46d8d9a10f748a87698709f4 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 22 Dec 2020 11:00:14 -0600 Subject: [PATCH 01/12] 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 451a0120b177..82860b6f7eb7 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.7'; + const VERSION = '6.20.8'; /** * The base path for the Laravel installation. From 53e91ef529ece38cb613e57840fae8be64da1d32 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Wed, 23 Dec 2020 00:38:35 +0200 Subject: [PATCH 02/12] [6.x] update changelog --- CHANGELOG-6.x.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 8ec4a08e9afe..078fe3776c23 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,13 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.7...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.8...6.x) + + +## [v6.20.8 (2020-12-22)](https://github.com/laravel/framework/compare/v6.20.7...v6.20.8) + +### Fixed +- Fixed `Illuminate\Validation\Concerns\ValidatesAttributes::validateJson()` for PHP8 ([#35646](https://github.com/laravel/framework/pull/35646)) +- Catch DecryptException with invalid X-XSRF-TOKEN in `Illuminate\Foundation\Http\Middleware\VerifyCsrfToken` ([#35671](https://github.com/laravel/framework/pull/35671)) ## [v6.20.7 (2020-12-08)](https://github.com/laravel/framework/compare/v6.20.6...v6.20.7) From 85193e8fdd91c9ca9f705e3d861a3ca4377be646 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Wed, 23 Dec 2020 00:45:03 +0200 Subject: [PATCH 03/12] [7.x] update changelog --- CHANGELOG-6.x.md | 9 ++++++++- CHANGELOG-7.x.md | 11 ++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 8ec4a08e9afe..078fe3776c23 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,13 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.7...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.8...6.x) + + +## [v6.20.8 (2020-12-22)](https://github.com/laravel/framework/compare/v6.20.7...v6.20.8) + +### Fixed +- Fixed `Illuminate\Validation\Concerns\ValidatesAttributes::validateJson()` for PHP8 ([#35646](https://github.com/laravel/framework/pull/35646)) +- Catch DecryptException with invalid X-XSRF-TOKEN in `Illuminate\Foundation\Http\Middleware\VerifyCsrfToken` ([#35671](https://github.com/laravel/framework/pull/35671)) ## [v6.20.7 (2020-12-08)](https://github.com/laravel/framework/compare/v6.20.6...v6.20.7) diff --git a/CHANGELOG-7.x.md b/CHANGELOG-7.x.md index 7ef94e06eee9..2a0534809019 100644 --- a/CHANGELOG-7.x.md +++ b/CHANGELOG-7.x.md @@ -1,6 +1,15 @@ # Release Notes for 7.x -## [Unreleased](https://github.com/laravel/framework/compare/v7.30.0...7.x) +## [Unreleased](https://github.com/laravel/framework/compare/v7.30.1...7.x) + + +## [v7.30.1 (2020-12-22)](https://github.com/laravel/framework/compare/v7.30.0...v7.30.1) + +### Fixed +- Backport for fix issue with polymorphic morphMaps with literal 0 ([#35487](https://github.com/laravel/framework/pull/35487)) +- Fixed mime validation for jpeg files ([#35518](https://github.com/laravel/framework/pull/35518)) +- Fixed `Illuminate\Validation\Concerns\ValidatesAttributes::validateJson()` for PHP8 ([#35646](https://github.com/laravel/framework/pull/35646)) +- Catch DecryptException with invalid X-XSRF-TOKEN in `Illuminate\Foundation\Http\Middleware\VerifyCsrfToken` ([#35671](https://github.com/laravel/framework/pull/35671)) ## [v7.30.0 (2020-12-01)](https://github.com/laravel/framework/compare/v7.29.3...v7.30.0) From d2092774c80c632bdc98853dfbad16743cc898e4 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Tue, 29 Dec 2020 16:07:22 +0100 Subject: [PATCH 04/12] Update DetectsLostConnections.php (#35744) (#35752) AWS Aurora serverless DB sometimes aborts queries while performing scaling. The error returned is: "SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry." Co-authored-by: Sab --- src/Illuminate/Database/DetectsLostConnections.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php index 36b46099983f..6ba3c4939faa 100644 --- a/src/Illuminate/Database/DetectsLostConnections.php +++ b/src/Illuminate/Database/DetectsLostConnections.php @@ -45,6 +45,9 @@ protected function causedByLostConnection(Throwable $e) 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.', 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again', 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected', + 'SQLSTATE[HY000] [2002] Connection timed out', + 'SSL: Connection timed out', + 'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.', ]); } } From 4686f22eaaddca3fd71f99290e833413cfcf8f4c Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 5 Jan 2021 09:42:30 -0600 Subject: [PATCH 05/12] 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 82860b6f7eb7..140615a3ce68 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.8'; + const VERSION = '6.20.9'; /** * The base path for the Laravel installation. From 006180a54d917de4420c1aeddb7c0251d0189651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Aur=C3=A9lio=20Deleu?= Date: Tue, 5 Jan 2021 19:50:42 -0300 Subject: [PATCH 06/12] Retry if DNS lookup fails (#35790) --- src/Illuminate/Database/DetectsLostConnections.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Illuminate/Database/DetectsLostConnections.php b/src/Illuminate/Database/DetectsLostConnections.php index 6ba3c4939faa..07630c590d5c 100644 --- a/src/Illuminate/Database/DetectsLostConnections.php +++ b/src/Illuminate/Database/DetectsLostConnections.php @@ -44,6 +44,7 @@ protected function causedByLostConnection(Throwable $e) 'running with the --read-only option so it cannot execute this statement', 'The connection is broken and recovery is not possible. The connection is marked by the client driver as unrecoverable. No attempt was made to restore the connection.', 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again', + 'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known', 'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected', 'SQLSTATE[HY000] [2002] Connection timed out', 'SSL: Connection timed out', From 08b1b19ce0581d49d15321bdc1194aab1cb1b4b2 Mon Sep 17 00:00:00 2001 From: Joren Dandois Date: Wed, 6 Jan 2021 14:35:15 +0100 Subject: [PATCH 07/12] [6.x] Fix #35795 (#35797) Add an extra is_null check for php 8 --- src/Illuminate/Validation/Concerns/ValidatesAttributes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php index d62ec0ee9513..84e0964ba147 100644 --- a/src/Illuminate/Validation/Concerns/ValidatesAttributes.php +++ b/src/Illuminate/Validation/Concerns/ValidatesAttributes.php @@ -1164,7 +1164,7 @@ public function validateJson($attribute, $value) return false; } - if (! is_scalar($value) && ! method_exists($value, '__toString')) { + if (! is_scalar($value) && ! is_null($value) && ! method_exists($value, '__toString')) { return false; } From 7a0517e43d11d945bee7912dcc03ad4573cdece2 Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Wed, 6 Jan 2021 22:36:47 +0200 Subject: [PATCH 08/12] [6.x] update changelog --- CHANGELOG-6.x.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index 078fe3776c23..d92867e61bf9 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,12 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.8...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.9...6.x) + + +## [v6.20.9 (2021-01-05)](https://github.com/laravel/framework/compare/v6.20.8...v6.20.9) + +### Added +- [Updated Illuminate\Database\DetectsLostConnections with new strings](https://github.com/laravel/framework/compare/v6.20.8...v6.20.9) ## [v6.20.8 (2020-12-22)](https://github.com/laravel/framework/compare/v6.20.7...v6.20.8) From 88dced8fc1016411ca159fc04651baf270aa54e5 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Tue, 12 Jan 2021 09:30:21 -0600 Subject: [PATCH 09/12] 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 140615a3ce68..ae6e70351474 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.9'; + const VERSION = '6.20.10'; /** * The base path for the Laravel installation. From 594c08af2aad632a27c71efcc53e93caa3329e3d Mon Sep 17 00:00:00 2001 From: Tetiana Blindaruk Date: Tue, 12 Jan 2021 23:43:09 +0200 Subject: [PATCH 10/12] [6.x] update changelog --- CHANGELOG-6.x.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/CHANGELOG-6.x.md b/CHANGELOG-6.x.md index d92867e61bf9..3ab00165cccc 100644 --- a/CHANGELOG-6.x.md +++ b/CHANGELOG-6.x.md @@ -1,6 +1,15 @@ # Release Notes for 6.x -## [Unreleased](https://github.com/laravel/framework/compare/v6.20.9...6.x) +## [Unreleased](https://github.com/laravel/framework/compare/v6.20.10...6.x) + + +## [v6.20.10 (2021-01-12)](https://github.com/laravel/framework/compare/v6.20.9...v6.20.10) + +### Added +- Added new line to `DetectsLostConnections` ([#35790](https://github.com/laravel/framework/pull/35790)) + +### Fixed +- Fixed error from missing null check on PHP 8 in `Illuminate\Validation\Concerns\ValidatesAttributes::validateJson()` ([#35797](https://github.com/laravel/framework/pull/35797)) ## [v6.20.9 (2021-01-05)](https://github.com/laravel/framework/compare/v6.20.8...v6.20.9) From d0954f4574f315f0c2e9e65e92cc74b80eadcac1 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 13 Jan 2021 07:35:45 -0600 Subject: [PATCH 11/12] [6.x] Limit expected bindings (#35865) * limit expected bindings * limit more bindings --- src/Illuminate/Database/Query/Builder.php | 18 ++++++++--- tests/Database/DatabaseQueryBuilderTest.php | 34 ++++++++++----------- 2 files changed, 31 insertions(+), 21 deletions(-) diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php index 0d4c7c3ae16c..83416d83be02 100755 --- a/src/Illuminate/Database/Query/Builder.php +++ b/src/Illuminate/Database/Query/Builder.php @@ -698,7 +698,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and' ); if (! $value instanceof Expression) { - $this->addBinding($value, 'where'); + $this->addBinding(is_array($value) ? head($value) : $value, 'where'); } return $this; @@ -1043,7 +1043,7 @@ public function whereBetween($column, array $values, $boolean = 'and', $not = fa $this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not'); - $this->addBinding($this->cleanBindings($values), 'where'); + $this->addBinding(array_slice($this->cleanBindings($values), 0, 2), 'where'); return $this; } @@ -1111,6 +1111,8 @@ public function whereDate($column, $operator, $value = null, $boolean = 'and') $value, $operator, func_num_args() === 2 ); + $value = is_array($value) ? head($value) : $value; + if ($value instanceof DateTimeInterface) { $value = $value->format('Y-m-d'); } @@ -1150,6 +1152,8 @@ public function whereTime($column, $operator, $value = null, $boolean = 'and') $value, $operator, func_num_args() === 2 ); + $value = is_array($value) ? head($value) : $value; + if ($value instanceof DateTimeInterface) { $value = $value->format('H:i:s'); } @@ -1189,6 +1193,8 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and') $value, $operator, func_num_args() === 2 ); + $value = is_array($value) ? head($value) : $value; + if ($value instanceof DateTimeInterface) { $value = $value->format('d'); } @@ -1232,6 +1238,8 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and') $value, $operator, func_num_args() === 2 ); + $value = is_array($value) ? head($value) : $value; + if ($value instanceof DateTimeInterface) { $value = $value->format('m'); } @@ -1275,6 +1283,8 @@ public function whereYear($column, $operator, $value = null, $boolean = 'and') $value, $operator, func_num_args() === 2 ); + $value = is_array($value) ? head($value) : $value; + if ($value instanceof DateTimeInterface) { $value = $value->format('Y'); } @@ -1583,7 +1593,7 @@ public function whereJsonLength($column, $operator, $value = null, $boolean = 'a $this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof Expression) { - $this->addBinding($value); + $this->addBinding((int) $value); } return $this; @@ -1732,7 +1742,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and $this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean'); if (! $value instanceof Expression) { - $this->addBinding($value, 'having'); + $this->addBinding(is_array($value) ? head($value) : $value, 'having'); } return $this; diff --git a/tests/Database/DatabaseQueryBuilderTest.php b/tests/Database/DatabaseQueryBuilderTest.php index 87f7268a565b..407b312ee5bf 100755 --- a/tests/Database/DatabaseQueryBuilderTest.php +++ b/tests/Database/DatabaseQueryBuilderTest.php @@ -301,24 +301,24 @@ public function testBasicWheres() public function testWheresWithArrayValue() { $builder = $this->getBuilder(); - $builder->select('*')->from('users')->where('id', [12, 30]); + $builder->select('*')->from('users')->where('id', [12]); $this->assertSame('select * from "users" where "id" = ?', $builder->toSql()); - $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); - - $builder = $this->getBuilder(); - $builder->select('*')->from('users')->where('id', '=', [12, 30]); - $this->assertSame('select * from "users" where "id" = ?', $builder->toSql()); - $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); - - $builder = $this->getBuilder(); - $builder->select('*')->from('users')->where('id', '!=', [12, 30]); - $this->assertSame('select * from "users" where "id" != ?', $builder->toSql()); - $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); - - $builder = $this->getBuilder(); - $builder->select('*')->from('users')->where('id', '<>', [12, 30]); - $this->assertSame('select * from "users" where "id" <> ?', $builder->toSql()); - $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); + $this->assertEquals([0 => 12], $builder->getBindings()); + + // $builder = $this->getBuilder(); + // $builder->select('*')->from('users')->where('id', '=', [12, 30]); + // $this->assertSame('select * from "users" where "id" = ?', $builder->toSql()); + // $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); + + // $builder = $this->getBuilder(); + // $builder->select('*')->from('users')->where('id', '!=', [12, 30]); + // $this->assertSame('select * from "users" where "id" != ?', $builder->toSql()); + // $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); + + // $builder = $this->getBuilder(); + // $builder->select('*')->from('users')->where('id', '<>', [12, 30]); + // $this->assertSame('select * from "users" where "id" <> ?', $builder->toSql()); + // $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings()); } public function testMySqlWrappingProtectsQuotationMarks() From 29c831df184f1dff7ee1444352472b037241d340 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Wed, 13 Jan 2021 07:36:19 -0600 Subject: [PATCH 12/12] 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 ae6e70351474..97a41bb7711c 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.10'; + const VERSION = '6.20.11'; /** * The base path for the Laravel installation.