BUGFIX #6219 Director::direct() validation fails for doubly nested file 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
This commit is contained in:
Sean Harvey 2010-12-14 00:17:24 +00:00 committed by Sam Minnee
parent c00e5a384b
commit 521a76b880

View File

@ -93,7 +93,8 @@ class Director {
// 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);
}