Skip to content

Commit

Permalink
BUGFIX Validating $_FILES in Image::loadUploadedImage() (Original pat…
Browse files Browse the repository at this point in the history
…ch was applied to Upload->validate() in trunk - r73254)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.2@73295 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information
Sean Harvey authored and Sam Minnee committed Feb 2, 2011
1 parent 5f13d41 commit e9217a7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/model/Image.php
Expand Up @@ -127,6 +127,11 @@ function loadUploadedImage($tmpFile) {
return;
}

if(isset($tmpFile['tmp_name']) && !is_uploaded_file($tmpFile['tmp_name'])) {
user_error("Image::loadUploadedImage() Image file is not a valid upload", E_USER_ERROR);
return false;
}

$base = dirname(dirname($_SERVER['SCRIPT_FILENAME']));
$class = $this->class;

Expand Down

0 comments on commit e9217a7

Please sign in to comment.