Ansi sql encode quotes

This commit is contained in:
Damian Mooyman 2015-05-14 11:09:35 +12:00
parent eb32e495cc
commit 083d4d60cb

View File

@ -24,8 +24,8 @@ class BlogFilter extends Lumberjack {
}
$dataQuery = $staged->dataQuery()
->innerJoin('BlogPost', sprintf('BlogPost%s.ID = SiteTree%s.ID', $stage, $stage))
->where(sprintf('PublishDate < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
->innerJoin('BlogPost', sprintf('"BlogPost%s"."ID" = "SiteTree%s"."ID"', $stage, $stage))
->where(sprintf('"BlogPost"."PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
$staged = $staged->setDataQuery($dataQuery);
}
@ -48,8 +48,8 @@ class BlogFilter extends Lumberjack {
if(!$this->shouldFilter() && $this->isBlog() && !Permission::check('VIEW_DRAFT_CONTENT')) {
$dataQuery = $staged->dataQuery()
->innerJoin('BlogPost', 'BlogPost_Live.ID = SiteTree_Live.ID')
->where(sprintf('PublishDate < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
->innerJoin('BlogPost', '"BlogPost_Live"."ID" = "SiteTree_Live"."ID"')
->where(sprintf('"BlogPost"."PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
$staged = $staged->setDataQuery($dataQuery);
}