8000 version · laravel/framework@405ca2b · GitHub
[go: up one dir, main page]

Skip to content

Commit 405ca2b

Browse files
committed
version
2 parents 502ed3a + 29c831d commit 405ca2b

File tree

6 files changed

+53
-24
lines changed

6 files changed

+53
-24
lines changed

CHANGELOG-6.x.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
11
# Release Notes for 6.x
22

3-
## [Unreleased](https://github.com/laravel/framework/compare/v6.20.8...6.x)
3+
## [Unreleased](https://github.com/laravel/framework/compare/v6.20.10...6.x)
4+
5+
6+
## [v6.20.10 (2021-01-12)](https://github.com/laravel/framework/compare/v6.20.9...v6.20.10)
7+
8+
### Added
9+
- Added new line to `DetectsLostConnections` ([#35790](https://github.com/laravel/framework/pull/35790))
10+
11+
### Fixed
12+
- Fixed error from missing null check on PHP 8 in `Illuminate\Validation\Concerns\ValidatesAttributes::validateJson()` ([#35797](https://github.com/laravel/framework/pull/35797))
13+
14+
15+
## [v6.20.9 (2021-01-05)](https://github.com/laravel/framework/compare/v6.20.8...v6.20.9)
16+
17+
### Added
18+
- [Updated Illuminate\Database\DetectsLostConnections with new strings](https://github.com/laravel/framework/compare/v6.20.8...v6.20.9)
419

520

621
## [v6.20.8 (2020-12-22)](https://github.com/laravel/framework/compare/v6.20.7...v6.20.8)

src/Illuminate/Database/DetectsLostConnections.php

+4
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ protected function causedByLostConnection(Throwable $e)
4444
'running with the --read-only option so it cannot execute this statement',
4545
'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.',
4646
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Try again',
47+
'SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known',
4748
'SQLSTATE[HY000]: General error: 7 SSL SYSCALL error: EOF detected',
49+
'SQLSTATE[HY000] [2002] Connection timed out',
50+
'SSL: Connection timed out',
51+
'SQLSTATE[HY000]: General error: 1105 The last transaction was aborted due to Seamless Scaling. Please retry.',
4852
]);
4953
}
5054
}

src/Illuminate/Database/Query/Builder.php

+14-4
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ public function where($column, $operator = null, $value = null, $boolean = 'and'
709709
);
710710

711711
if (! $value instanceof Expression) {
712-
$this->addBinding($value, 'where');
712+
$this->addBinding(is_array($value) ? head($value) : $value, 'where');
713713
}
714714

715715
return $this;
@@ -1078,7 +1078,7 @@ public function whereBetween($column, array $values, $boolean = 'and', $not = fa
10781078

10791079
$this->wheres[] = compact('type', 'column', 'values', 'boolean', 'not');
10801080

1081-
$this->addBinding($this->cleanBindings($values), 'where');
1081+
$this->addBinding(array_slice($this->cleanBindings($values), 0, 2), 'where');
10821082

10831083
return $this;
10841084
}
@@ -1201,6 +1201,8 @@ public function whereDate($column, $operator, $value = null, $boolean = 'and')
12011201
$value, $operator, func_num_args() === 2
12021202
);
12031203

1204+
$value = is_array($value) ? head($value) : $value;
1205+
12041206
if ($value instanceof DateTimeInterface) {
12051207
$value = $value->format('Y-m-d');
12061208
}
@@ -1240,6 +1242,8 @@ public function whereTime($column, $operator, $value = null, $boolean = 'and')
12401242
$value, $operator, func_num_args() === 2
12411243
);
12421244

1245+
$value = is_array($value) ? head($value) : $value;
1246+
12431247
if ($value instanceof DateTimeInterface) {
12441248
$value = $value->format('H:i:s');
12451249
}
@@ -1279,6 +1283,8 @@ public function whereDay($column, $operator, $value = null, $boolean = 'and')
12791283
$value, $operator, func_num_args() === 2
12801284
);
12811285

1286+
$value = is_array($value) ? head($value) : $value;
1287+
12821288
if ($value instanceof DateTimeInterface) {
12831289
$value = $value->format('d');
12841290
}
@@ -1322,6 +1328,8 @@ public function whereMonth($column, $operator, $value = null, $boolean = 'and')
13221328
$value, $operator, func_num_args() === 2
13231329
);
13241330

1331+
$value = is_array($value) ? head($value) : $value;
1332+
13251333
if ($value instanceof DateTimeInterface) {
13261334
$value = $value->format('m');
13271335
}
@@ -1365,6 +1373,8 @@ public function whereYear($column, $operator, $value = null, $boolean = 'and')
13651373
$value, $operator, func_num_args() === 2
13661374
);
13671375

1376+
$value = is_array($value) ? head($value) : $value;
1377+
13681378
if ($value instanceof DateTimeInterface) {
13691379
$value = $value->format('Y');
13701380
}
@@ -1673,7 +1683,7 @@ public function whereJsonLength($column, $operator, $value = null, $boolean = 'a
16731683
$this->wheres[] = compact('type', 'column', 'operator', 'value', 'boolean');
16741684

16751685
if (! $value instanceof Expression) {
1676-
$this->addBinding($value);
1686+
$this->addBinding((int) $value);
16771687
}
16781688

16791689
return $this;
@@ -1822,7 +1832,7 @@ public function having($column, $operator = null, $value = null, $boolean = 'and
18221832
$this->havings[] = compact('type', 'column', 'operator', 'value', 'boolean');
18231833

18241834
if (! $value instanceof Expression) {
1825-
$this->addBinding($value, 'having');
1835+
$this->addBinding(is_array($value) ? head($value) : $value, 'having');
18261836
}
18271837

18281838
return $this;

src/Illuminate/Foundation/Application.php

+1-1
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.30.1';
36+
const VERSION = '7.30.2';
3737

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

src/Illuminate/Validation/Concerns/ValidatesAttributes.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1174,7 +1174,7 @@ public function validateJson($attribute, $value)
11741174
return false;
11751175
}
11761176

1177-
if (! is_scalar($value) && ! method_exists($value, '__toString')) {
1177+
if (! is_scalar($value) && ! is_null($value) && ! method_exists($value, '__toString')) {
11781178
return false;
11791179
}
11801180

tests/Database/DatabaseQueryBuilderTest.php

+17-17
Original file line numberDiff line numberDiff line change
@@ -301,24 +301,24 @@ public function testBasicWheres()
301301
public function testWheresWithArrayValue()
302302
{
303303
$builder = $this->getBuilder();
304-
$builder->select('*')->from('users')->where('id', [12, 30]);
304+
$builder->select('*')->from('users')->where('id', [12]);
305305
$this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
306-
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
307-
308-
$builder = $this->getBuilder();
309-
$builder->select('*')->from('users')->where('id', '=', [12, 30]);
310-
$this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
311-
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
312-
313-
$builder = $this->getBuilder();
314-
$builder->select('*')->from('users')->where('id', '!=', [12, 30]);
315-
$this->assertSame('select * from "users" where "id" != ?', $builder->toSql());
316-
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
317-
318-
$builder = $this->getBuilder();
319-
$builder->select('*')->from('users')->where('id', '<>', [12, 30]);
320-
$this->assertSame('select * from "users" where "id" <> ?', $builder->toSql());
321-
$this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
306+
$this->assertEquals([0 => 12], $builder->getBindings());
307+
308+
// $builder = $this->getBuilder();
309+
// $builder->select('*')->from('users')->where('id', '=', [12, 30]);
310+
// $this->assertSame('select * from "users" where "id" = ?', $builder->toSql());
311+
// $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
312+
313+
// $builder = $this->getBuilder();
314+
// $builder->select('*')->from('users')->where('id', '!=', [12, 30]);
315+
// $this->assertSame('select * from "users" where "id" != ?', $builder->toSql());
316+
// $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
317+
318+
// $builder = $this->getBuilder();
319+
// $builder->select('*')->from('users')->where('id', '<>', [12, 30]);
320+
// $this->assertSame('select * from "users" where "id" <> ?', $builder->toSql());
321+
// $this->assertEquals([0 => 12, 1 => 30], $builder->getBindings());
322322
}
323323

324324
public function testMySqlWrappingProtectsQuotationMarks()

0 commit comments

Comments
 (0)
0