BUGFIX: Can't upload files to root folder

This commit is contained in:
Stig Lindqvist 2012-01-10 14:02:19 +13:00
parent 1f190eb698
commit 7de585103f

View File

@ -202,8 +202,11 @@ JS
}
$processedData = array_reverse($processedData);
if($data['FolderID'] && $data['FolderID'] != '') $folder = DataObject::get_by_id("Folder", $data['FolderID']);
else $folder = singleton('Folder');
if(isset($data['FolderID']) && is_numeric($data['FolderID'])) {
$folder = DataObject::get_by_id("Folder", $data['FolderID']);
} else {
$folder = singleton('Folder');
}
foreach($processedFiles as $filePostId => $tmpFile) {
if($tmpFile['error'] == UPLOAD_ERR_NO_TMP_DIR) {