BUGFIX fixed a situation which would trigger a crash (from r88573)

This commit is contained in:
Tom Rix 2010-03-01 21:55:40 +00:00
parent f12eee0679
commit ba1db5ae24

View File

@ -52,7 +52,7 @@ class FileSubsites extends DataObjectDecorator {
else $q='`';
// If you're querying by ID, ignore the sub-site - this is a bit ugly... (but it was WAYYYYYYYYY worse)
if(!preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0])) {
if(!$query->where || !preg_match('/\.(\'|"|`|)ID(\'|"|`|)/', $query->where[0])) {
if($context = DataObject::context_obj()) $subsiteID = (int) $context->SubsiteID;
else $subsiteID = (int) Subsite::currentSubsiteID();