diff --git a/composer.json b/composer.json index b9a4b6e2b76..95b0e6d8c15 100644 --- a/composer.json +++ b/composer.json @@ -19,7 +19,8 @@ "danielstjules/stringy": "3.*", "adodb/adodb-php": "dev-v5.20.14-mods", "gettext/gettext": "^4.6", - "sokil/php-isocodes": "^3.0" + "sokil/php-isocodes": "^3.0", + "cweagans/composer-patches": "^1.7" }, "require-dev": { "phpunit/phpunit": "~8", @@ -37,5 +38,12 @@ "type": "vcs", "url": "https://github.com/asmecher/ADOdb" } - ] + ], + "extra": { + "patches": { + "illuminate/database": { + "Patch Laravel binding array issue": "lib/laravel-binding-6632.diff" + } + } + } } diff --git a/composer.lock b/composer.lock index f2ecce7dcd1..b8c38221472 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "e4098494392293817bcbab537004b19a", + "content-hash": "4918d88bb2e9bd97fc88b981bffec029", "packages": [ { "name": "adodb/adodb-php", @@ -225,6 +225,50 @@ "description": "jQuery UI is a curated set of user interface interactions, effects, widgets, and themes built on top of the jQuery JavaScript Library. Whether you're building highly interactive web applications or you just need to add a date picker to a form control, jQuery UI is the perfect choice.", "time": "2016-09-16T05:47:55+00:00" }, + { + "name": "cweagans/composer-patches", + "version": "1.7.0", + "source": { + "type": "git", + "url": "https://github.com/cweagans/composer-patches.git", + "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/cweagans/composer-patches/zipball/ae02121445ad75f4eaff800cc532b5e6233e2ddf", + "reference": "ae02121445ad75f4eaff800cc532b5e6233e2ddf", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0 || ^2.0", + "php": ">=5.3.0" + }, + "require-dev": { + "composer/composer": "~1.0 || ~2.0", + "phpunit/phpunit": "~4.6" + }, + "type": "composer-plugin", + "extra": { + "class": "cweagans\\Composer\\Patches" + }, + "autoload": { + "psr-4": { + "cweagans\\Composer\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Cameron Eagans", + "email": "me@cweagans.net" + } + ], + "description": "Provides a way to patch Composer packages.", + "time": "2020-09-30T17:56:20+00:00" + }, { "name": "danielstjules/stringy", "version": "3.1.0", @@ -4351,5 +4395,6 @@ "platform-dev": [], "platform-overrides": { "php": "7.2.0" - } + }, + "plugin-api-version": "1.1.0" } diff --git a/lib/laravel-binding-6632.diff b/lib/laravel-binding-6632.diff new file mode 100644 index 00000000000..b872525d1da --- /dev/null +++ b/lib/laravel-binding-6632.diff @@ -0,0 +1,85 @@ +diff --git a/src/Illuminate/Database/Query/Builder.php b/src/Illuminate/Database/Query/Builder.php +index 0d4c7c3ae16..83416d83be0 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;