Uncasted user input cause SQL issues

This commit is contained in:
Stephen Shkardoon 2013-03-24 23:30:44 +13:00
parent 6f1f3a2c40
commit 5c9a962b21

View File

@ -180,7 +180,7 @@ class FieldEditor extends FormField {
$parentID = $this->form->getRecord()->ID; $parentID = $this->form->getRecord()->ID;
if($parentID) { if($parentID) {
$parentID = Convert::raw2sql($parentID); $parentID = (int)$parentID;
$sqlQuery = new SQLQuery(); $sqlQuery = new SQLQuery();
$sqlQuery = $sqlQuery $sqlQuery = $sqlQuery
@ -222,7 +222,7 @@ class FieldEditor extends FormField {
// work out the sort by getting the sort of the last field in the form +1 // work out the sort by getting the sort of the last field in the form +1
if($parent) { if($parent) {
$sql_parent = Convert::raw2sql($parent); $sql_parent = (int)$parent;
$sqlQuery = new SQLQuery(); $sqlQuery = new SQLQuery();
$sqlQuery = $sqlQuery $sqlQuery = $sqlQuery