mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 19:38:26 +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);
|
$count = count($fields);
|
||||||
|
|
||||||
if ($count >= 1 && strpos($fields[0], 'COUNT(*)') === false) {
|
if ($count >= 1 && !preg_match('/^\s*COUNT\(/', $fields[0])) {
|
||||||
$result = array();
|
$result = array();
|
||||||
for ($i = 0; $i < $count; $i++) {
|
for ($i = 0; $i < $count; $i++) {
|
||||||
if (!preg_match('/^.+\\(.*\\)/', $fields[$i]) && !preg_match('/\s+AS\s+/', $fields[$i])) {
|
if (!preg_match('/^.+\\(.*\\)/', $fields[$i]) && !preg_match('/\s+AS\s+/', $fields[$i])) {
|
||||||
|
|
Loading…
Reference in a new issue