Skip to content

Commit

Permalink
Merge pull request #976 from ss23/SS2014004-3-0
Browse files Browse the repository at this point in the history
FIX Prevent SQLi when no URL filters are applied
  • Loading branch information
Damian Mooyman committed Mar 26, 2014
2 parents b6194c3 + 114df8a commit 43d308c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/model/SiteTree.php
Expand Up @@ -1584,9 +1584,10 @@ public function validURLSegment() {
}
}

$segment = Convert::raw2sql($this->URLSegment);
$existingPage = DataObject::get_one(
'SiteTree',
"\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter"
"\"URLSegment\" = '$segment' $IDFilter $parentFilter"
);
if ($existingPage) {
return false;
Expand Down

0 comments on commit 43d308c

Please sign in to comment.