diff --git a/code/FileSubsites.php b/code/FileSubsites.php index 19c4e9f..ed1e817 100755 --- a/code/FileSubsites.php +++ b/code/FileSubsites.php @@ -47,10 +47,6 @@ class FileSubsites extends DataObjectDecorator { * Update any requests to limit the results to the current site */ function augmentSQL(SQLQuery &$query) { - if(defined('DB::USE_ANSI_SQL')) - $q="\""; - else $q='`'; - // If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse) if(!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0])) { if($context = DataObject::context_obj()) $subsiteID = (int) $context->SubsiteID; @@ -58,12 +54,12 @@ class FileSubsites extends DataObjectDecorator { // The foreach is an ugly way of getting the first key :-) foreach($query->from as $tableName => $info) { - $where = "{$q}$tableName{$q}.{$q}SubsiteID{$q} IN (0, $subsiteID)"; + $where = "\"$tableName\".\"SubsiteID\" IN (0, $subsiteID)"; $query->where[] = $where; break; } - $query->orderby = "\"SubsiteID\"" . ($query->orderby ? ', ' : '') . $query->orderby; + $query->orderby = "\"SubsiteID\"" . ($query->orderby ? ', ' : '') . $query->orderby; } }