Escape $stage

Although I don't *think* this is vulnerable, the $stage variable ultimately comes from a $_GET variable so should be escaped. Without this the security remains weak and could cause issues if the Versioned code is changed.
This commit is contained in:
Michael Strong 2015-06-03 10:46:35 +12:00
parent bfeddba670
commit 459468cc67

View File

@ -23,6 +23,7 @@ class BlogFilter extends Lumberjack {
$stage = '_' . $stage;
}
$stage = Convert::raw2sql($stage);
$dataQuery = $staged->dataQuery()
->innerJoin('BlogPost', sprintf('"BlogPost%s"."ID" = "SiteTree%s"."ID"', $stage, $stage))
->where(sprintf('"PublishDate" < \'%s\'', Convert::raw2sql(SS_Datetime::now())));