From 65c8a96265290fee3245875d0e94ab98a4360e58 Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Thu, 11 Jan 2024 12:19:02 +0100 Subject: [PATCH 1/6] When having query with casting like ::text parameter are bounded wrongly; --- src/Objects/Concerns/ReplacesBindings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Objects/Concerns/ReplacesBindings.php b/src/Objects/Concerns/ReplacesBindings.php index 7edcf85..ba8db16 100644 --- a/src/Objects/Concerns/ReplacesBindings.php +++ b/src/Objects/Concerns/ReplacesBindings.php @@ -92,7 +92,7 @@ protected function getRegex() return $this->wrapRegex( $this->notInsideQuotes('?') . '|' . - $this->notInsideQuotes('\:\w+', false) + $this->notInsideQuotes('[^:]\:\w+', false) ); } From 19e3fc20e9fb28c6a423a8443a79489e83b404c7 Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Fri, 22 Mar 2024 19:46:06 +0100 Subject: [PATCH 2/6] Binding with parameter ?& is not working properly; --- src/Objects/Concerns/ReplacesBindings.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Objects/Concerns/ReplacesBindings.php b/src/Objects/Concerns/ReplacesBindings.php index ba8db16..84026e6 100644 --- a/src/Objects/Concerns/ReplacesBindings.php +++ b/src/Objects/Concerns/ReplacesBindings.php @@ -16,6 +16,7 @@ trait ReplacesBindings */ protected function replaceBindings($sql, array $bindings) { + $sql = str_replace('??&', '__qm_amp__', $sql); $generalRegex = $this->getRegex(); foreach ($this->formatBindings($bindings) as $key => $binding) { @@ -23,7 +24,7 @@ protected function replaceBindings($sql, array $bindings) $sql = preg_replace($regex, $this->value($binding), $sql, 1); } - return $sql; + return str_replace('__qm_amp__', '?&', $sql); } /** @@ -90,7 +91,7 @@ protected function formatBindings($bindings) protected function getRegex() { return $this->wrapRegex( - $this->notInsideQuotes('?') + $this->notInsideQuotes('?[^$]') . '|' . $this->notInsideQuotes('[^:]\:\w+', false) ); From 22a9d6c52f5270b1b484678d44419b1b3fc02602 Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Thu, 27 Jun 2024 23:03:57 +0200 Subject: [PATCH 3/6] Update dependencies; --- composer.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index d6fe3da..f00224a 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ } ], "require": { - "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*", - "mnabialek/laravel-version": "^1.0.6", + "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", + "mnabialek/laravel-version": "^v1.0.8", "nesbot/carbon": "~1.0 || ^2.0", - "illuminate/filesystem": "5.*|6.*|7.*|8.*|9.*|10.*", - "illuminate/container": "5.*|6.*|7.*|8.*|9.*|10.*" + "illuminate/filesystem": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", + "illuminate/container": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3.0", From 5c5bec83db717c2764ea170ccb06a73d86f47e1e Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Thu, 8 Aug 2024 14:29:22 +0200 Subject: [PATCH 4/6] Fix query; --- src/Objects/Concerns/ReplacesBindings.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Objects/Concerns/ReplacesBindings.php b/src/Objects/Concerns/ReplacesBindings.php index 84026e6..2ba88ad 100644 --- a/src/Objects/Concerns/ReplacesBindings.php +++ b/src/Objects/Concerns/ReplacesBindings.php @@ -91,7 +91,7 @@ protected function formatBindings($bindings) protected function getRegex() { return $this->wrapRegex( - $this->notInsideQuotes('?[^$]') + $this->notInsideQuotes('?') . '|' . $this->notInsideQuotes('[^:]\:\w+', false) ); From 33a59284a738fd2a254b6ae265042601864230fb Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Thu, 29 Aug 2024 13:48:46 +0200 Subject: [PATCH 5/6] Extends deps; --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index f00224a..8afceda 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", "mnabialek/laravel-version": "^v1.0.8", - "nesbot/carbon": "~1.0 || ^2.0", + "nesbot/carbon": "~1.0 || ^2.0 || ^~3", "illuminate/filesystem": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", "illuminate/container": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*" }, From de2657d721759d8fc6a40e5709a8ccbed97eb662 Mon Sep 17 00:00:00 2001 From: Robert Bochenski Date: Thu, 29 Aug 2024 13:49:43 +0200 Subject: [PATCH 6/6] Extends deps; --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 8afceda..aeab68b 100644 --- a/composer.json +++ b/composer.json @@ -12,7 +12,7 @@ "require": { "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", "mnabialek/laravel-version": "^v1.0.8", - "nesbot/carbon": "~1.0 || ^2.0 || ^~3", + "nesbot/carbon": "~1.0 || ^2.0 || ^3", "illuminate/filesystem": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*", "illuminate/container": "5.*|6.*|7.*|8.*|9.*|10.*|11.*|12.*" },