From 715f864d3d4ee7afb9e78975dcd7da30c7738d81 Mon Sep 17 00:00:00 2001 From: Geoff Munn Date: Mon, 1 Nov 2010 02:59:33 +0000 Subject: [PATCH] MINOR: Column names escaped properly git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@113300 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/CMSSiteTreeFilter.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/CMSSiteTreeFilter.php b/code/CMSSiteTreeFilter.php index 441d79a2..1a77357b 100644 --- a/code/CMSSiteTreeFilter.php +++ b/code/CMSSiteTreeFilter.php @@ -74,8 +74,8 @@ abstract class CMSSiteTreeFilter extends Object { if(!empty($parents)) { $q = new SQLQuery(); - $q->select(array('ID','ParentID')) - ->from('SiteTree') + $q->select(array('"ID"','"ParentID"')) + ->from('"SiteTree"') ->where('"ID" in ('.implode(',',array_keys($parents)).')'); foreach($q->execute() as $row) { @@ -145,8 +145,8 @@ class CMSSiteTreeFilter_ChangedPages extends CMSSiteTreeFilter { $ids = array(); $q = new SQLQuery(); $q->select(array('"SiteTree"."ID"','"SiteTree"."ParentID"')) - ->from('SiteTree') - ->leftJoin("SiteTree_Live", '"SiteTree_Live"."ID" = "SiteTree"."ID"') + ->from('"SiteTree"') + ->leftJoin('SiteTree_Live', '"SiteTree_Live"."ID" = "SiteTree"."ID"') ->where('"SiteTree"."Version" > "SiteTree_Live"."Version"'); foreach($q->execute() as $row) { @@ -176,8 +176,8 @@ class CMSSiteTreeFilter_Search extends CMSSiteTreeFilter { function pagesIncluded() { $ids = array(); $q = new SQLQuery(); - $q->select(array('ID','ParentID')) - ->from('SiteTree'); + $q->select(array('"ID"','"ParentID"')) + ->from('"SiteTree"'); $where = array(); $SQL_params = Convert::raw2sql($this->params);