mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 11:28:25 +00:00
Preventing false positive in queries returning fields but havinf Count(*) inside them in DboPostgres
This commit is contained in:
parent
d0fc2fd171
commit
09487f830c
1 changed files with 1 additions and 1 deletions
|
@ -361,7 +361,7 @@ class DboPostgres extends DboSource {
|
|||
}
|
||||
$count = count($fields);
|
||||
|
||||
if ($count >= 1 && strpos($fields[0], 'COUNT(*)') === false) {
|
||||
if ($count >= 1 && !preg_match('/^\s*COUNT\(/', $fields[0])) {
|
||||
$result = array();
|
||||
for ($i = 0; $i < $count; $i++) {
|
||||
if (!preg_match('/^.+\\(.*\\)/', $fields[$i]) && !preg_match('/\s+AS\s+/', $fields[$i])) {
|
||||
|
|
Loading…
Reference in a new issue