Skip to content

Commit

Permalink
Merge pull request #345 from frankmullenger/frankmullenger-sql-patch
Browse files Browse the repository at this point in the history
FIX: Casting to integer to prevent potential SQL injection.
  • Loading branch information
Damian Mooyman committed Sep 20, 2015
2 parents cc7a674 + 2cea1ce commit 606b20b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion code/model/UserDefinedForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ public function getCMSFields() {
);

// make sure a numeric not a empty string is checked against this int column for SQL server
$parentID = (!empty($self->ID)) ? $self->ID : 0;
$parentID = (!empty($self->ID)) ? (int)$self->ID : 0;

// get a list of all field names and values used for print and export CSV views of the GridField below.
$columnSQL = <<<SQL
Expand Down

0 comments on commit 606b20b

Please sign in to comment.