Skip to content

Commit

Permalink
FIX Prevent SQLi when no URL filters are applied
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Shkardoon committed Mar 19, 2014
1 parent b6194c3 commit 114df8a
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 114df8a

Please sign in to comment.