FIX Prevent SQLi when no URL filters are applied

This commit is contained in:
Stephen Shkardoon 2014-03-19 19:05:13 +13:00
parent 7002dcfa7f
commit 8e50405871

View File

@ -1643,9 +1643,10 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
return min($votes);
}
$segment = Convert::raw2sql($this->URLSegment);
$existingPage = DataObject::get_one(
'SiteTree',
"\"SiteTree\".\"URLSegment\" = '$this->URLSegment' $IDFilter $parentFilter"
"\"SiteTree\".\"URLSegment\" = '$segment' $IDFilter $parentFilter"
);
return !($existingPage);