mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Ignore final hyphen in column name when requoting
An expression like "Foo"."bar"->'prop' should not be re-quoted as "Foo"."bar-">'prop'. Bare columns cannot include hyphens in most DBs anyways.
This commit is contained in:
parent
12c6fd4e22
commit
9f9ae8a9fd
1 changed files with 1 additions and 1 deletions
|
@ -2884,7 +2884,7 @@ class DboSource extends DataSource {
|
|||
// Remove quotes and requote all the Model.field names.
|
||||
$conditions = str_replace(array($start, $end), '', $conditions);
|
||||
$conditions = preg_replace_callback(
|
||||
'/(?:[\'\"][^\'\"\\\]*(?:\\\.[^\'\"\\\]*)*[\'\"])|([a-z0-9_][a-z0-9\\-_]*\\.[a-z0-9_][a-z0-9_\\-]*)/i',
|
||||
'/(?:[\'\"][^\'\"\\\]*(?:\\\.[^\'\"\\\]*)*[\'\"])|([a-z0-9_][a-z0-9\\-_]*\\.[a-z0-9_][a-z0-9_\\-]*[a-z0-9_])/i',
|
||||
array(&$this, '_quoteMatchedField'),
|
||||
$conditions
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue