mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX Fixed SQL injection in Folder::findOrMake() parameter. Exploitable through Upload::, although unlikely to be set via user input.
This commit is contained in:
parent
551bc5dc72
commit
fef7c32535
@ -42,7 +42,14 @@ class Folder extends File {
|
|||||||
$item = null;
|
$item = null;
|
||||||
foreach($parts as $part) {
|
foreach($parts as $part) {
|
||||||
if(!$part) continue; // happens for paths with a trailing slash
|
if(!$part) continue; // happens for paths with a trailing slash
|
||||||
$item = DataObject::get_one("Folder", "\"Name\" = '$part' AND \"ParentID\" = $parentID");
|
$item = DataObject::get_one(
|
||||||
|
"Folder",
|
||||||
|
sprintf(
|
||||||
|
"\"Name\" = '%s' AND \"ParentID\" = %d",
|
||||||
|
Convert::raw2sql($part),
|
||||||
|
(int)$parentID
|
||||||
|
)
|
||||||
|
);
|
||||||
if(!$item) {
|
if(!$item) {
|
||||||
$item = new Folder();
|
$item = new Folder();
|
||||||
$item->ParentID = $parentID;
|
$item->ParentID = $parentID;
|
||||||
|
Loading…
Reference in New Issue
Block a user