mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 11:05:58 +02:00
Ansi sql encode quotes
This commit is contained in:
parent
eb32e495cc
commit
083d4d60cb
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user