Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Fixed possible SQL injection in file name part for File::find()

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@73437 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
commit 4513631a5446a4a41f30d8a3318370f1fd657e73 1 parent 3973a6a
@halkyon halkyon authored sminnee committed
Showing with 2 additions and 1 deletion.
  1. +2 −1  filesystem/File.php
View
3  filesystem/File.php
@@ -70,7 +70,8 @@ static function find($filename) {
foreach($parts as $part) {
if($part == "assets" && !$parentID) continue;
- $item = DataObject::get_one('File', "Name = '$part' AND ParentID = $parentID");
+ $SQL_part = Convert::raw2sql($part);
+ $item = DataObject::get_one('File', "Name = '$SQL_part' AND ParentID = $parentID");
if(!$item) break;
$parentID = $item->ID;
}

0 comments on commit 4513631

Please sign in to comment.
Something went wrong with that request. Please try again.