mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00: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()
|
$dataQuery = $staged->dataQuery()
|
||||||
->innerJoin('BlogPost', sprintf('BlogPost%s.ID = SiteTree%s.ID', $stage, $stage))
|
->innerJoin('BlogPost', sprintf('"BlogPost%s"."ID" = "SiteTree%s"."ID"', $stage, $stage))
|
||||||
->where(sprintf('PublishDate < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
|
->where(sprintf('"BlogPost"."PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
|
||||||
|
|
||||||
$staged = $staged->setDataQuery($dataQuery);
|
$staged = $staged->setDataQuery($dataQuery);
|
||||||
}
|
}
|
||||||
@ -48,8 +48,8 @@ class BlogFilter extends Lumberjack {
|
|||||||
|
|
||||||
if(!$this->shouldFilter() && $this->isBlog() && !Permission::check('VIEW_DRAFT_CONTENT')) {
|
if(!$this->shouldFilter() && $this->isBlog() && !Permission::check('VIEW_DRAFT_CONTENT')) {
|
||||||
$dataQuery = $staged->dataQuery()
|
$dataQuery = $staged->dataQuery()
|
||||||
->innerJoin('BlogPost', 'BlogPost_Live.ID = SiteTree_Live.ID')
|
->innerJoin('BlogPost', '"BlogPost_Live"."ID" = "SiteTree_Live"."ID"')
|
||||||
->where(sprintf('PublishDate < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
|
->where(sprintf('"BlogPost"."PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));
|
||||||
|
|
||||||
$staged = $staged->setDataQuery($dataQuery);
|
$staged = $staged->setDataQuery($dataQuery);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user