mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
MINOR: neatly quote identifiers
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@109405 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
801e3c958c
commit
0226781e37
@ -241,14 +241,14 @@ class SQLQuery {
|
|||||||
foreach($lumpedSortParts as $i => $sortPart) {
|
foreach($lumpedSortParts as $i => $sortPart) {
|
||||||
$sortPart = trim($sortPart);
|
$sortPart = trim($sortPart);
|
||||||
if(substr(strtolower($sortPart),-5) == ' desc') {
|
if(substr(strtolower($sortPart),-5) == ' desc') {
|
||||||
$this->select[] = substr($sortPart,0,-5) . " AS _SortColumn{$i}";
|
$this->select[] = substr($sortPart,0,-5) . " AS \"_SortColumn{$i}\"";
|
||||||
$newSorts[] = "_SortColumn{$i} DESC";
|
$newSorts[] = "\"_SortColumn{$i}\" DESC";
|
||||||
} else if(substr(strtolower($sortPart),-4) == ' asc') {
|
} else if(substr(strtolower($sortPart),-4) == ' asc') {
|
||||||
$this->select[] = substr($sortPart,0,-4) . " AS _SortColumn{$i}";
|
$this->select[] = substr($sortPart,0,-4) . " AS \"_SortColumn{$i}\"";
|
||||||
$newSorts[] = "_SortColumn{$i} ASC";
|
$newSorts[] = "\"_SortColumn{$i}\" ASC";
|
||||||
} else {
|
} else {
|
||||||
$this->select[] = "$sortPart AS _SortColumn{$i}";
|
$this->select[] = "$sortPart AS \"_SortColumn{$i}\"";
|
||||||
$newSorts[] = "_SortColumn{$i} ASC";
|
$newSorts[] = "\"_SortColumn{$i}\" ASC";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user