Permalink
Browse files

BUGFIX #6219 Director::direct() validation fails for doubly nested fi…

…le fields (thanks ajshort!) (from r114921)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.4@114922 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent c00e5a3 commit 521a76b8801de3931299c15a26a4f6672e9dcd88 @halkyon halkyon committed with sminnee Dec 14, 2010
Showing with 2 additions and 1 deletion.
  1. +2 −1 core/control/Director.php
@@ -93,7 +93,8 @@ static function direct($url) {
// Validate $_FILES array before merging it with $_POST
foreach($_FILES as $k => $v) {
if(is_array($v['tmp_name'])) {
- foreach($v['tmp_name'] as $tmpFile) {
+ $v = ArrayLib::array_values_recursive($v['tmp_name']);
+ foreach($v as $tmpFile) {
if($tmpFile && !is_uploaded_file($tmpFile)) {
user_error("File upload '$k' doesn't appear to be a valid upload", E_USER_ERROR);
}

0 comments on commit 521a76b

Please sign in to comment.