* [misc] The dm database cannot use alias for group by.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user