Merge pull request #105 from ss23/patch-1

Uncasted user input cause SQL issues
This commit is contained in:
Sam Minnée 2013-03-24 16:31:07 -07:00
commit 8fb39f846e

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