Commit 7fcf6437 authored by Son Nguyen's avatar Son Nguyen Committed by Gerrit Code Review
Browse files

Merge "Make sure the 'COUNT(*)' is not quoted for get_field() (Bug #1406372)"

parents 0d56666c 9b682972
...@@ -51,7 +51,8 @@ function db_quote_identifier($identifier) { ...@@ -51,7 +51,8 @@ function db_quote_identifier($identifier) {
// the sql standard " // the sql standard "
$identifier = trim($identifier); $identifier = trim($identifier);
if (strpos($identifier, '"') !== false if (strpos($identifier, '"') !== false
|| $identifier === '*') { || $identifier === '*'
|| preg_match('/count\(/i', $identifier)) {
return $identifier; return $identifier;
} }
return '"' . $identifier . '"'; return '"' . $identifier . '"';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment