* [misc] The dm database cannot use alias for group by.

This commit is contained in:
zhouxin
2024-07-10 14:18:46 +08:00
committed by 宋辰轩
parent abc7a06454
commit 04bacdbfb6
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -2501,11 +2501,16 @@ class baseSQL
public function groupBy($groupBy)
{
if($this->inCondition and !$this->conditionIsTrue) return $this;
//The dm database cannot use alias for group by
/*
if(!preg_match('/^\w+[a-zA-Z0-9_`.]+$/', $groupBy))
{
$groupBy = htmlspecialchars($groupBy);
helper::end("Group is bad query, The group is $groupBy");
}
*/
$this->sql .= ' ' . DAO::GROUPBY . " $groupBy";
return $this;
}
+5
View File
@@ -340,11 +340,16 @@ class sql extends baseSQL
public function groupBy($groupBy)
{
if($this->inCondition and !$this->conditionIsTrue) return $this;
//The dm database cannot use alias for group by
/*
if(!preg_match('/^[a-zA-Z0-9_`\.,\s\"]+$/', $groupBy))
{
$groupBy = htmlspecialchars($groupBy);
die("Group is bad query, The group is $groupBy");
}
*/
$this->sql .= ' ' . DAO::GROUPBY . " $groupBy";
return $this;
}