From 8c0f37c7f622b40587f99a2996492b1d0bc8441d Mon Sep 17 00:00:00 2001 From: steinm Date: Fri, 8 Feb 2013 14:55:26 +0000 Subject: [PATCH] - remove entry for uploaded file if drop folder file was selected --- op/op.AddDocument.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/op/op.AddDocument.php b/op/op.AddDocument.php index 4bf21289b..8d6f5c2ef 100644 --- a/op/op.AddDocument.php +++ b/op/op.AddDocument.php @@ -53,7 +53,7 @@ $comment = $_POST["comment"]; $version_comment = $_POST["version_comment"]; $keywords = $_POST["keywords"]; -$categories = $_POST["categories"]; +$categories = isset($_POST["categories"]) ? $_POST["categories"] : null; if(isset($_POST["attributes"])) $attributes = $_POST["attributes"]; else @@ -155,6 +155,11 @@ if($settings->_dropFolderDir) { if($_POST["dropfolderfileform1"]) { $fullfile = $settings->_dropFolderDir.'/'.$user->getLogin().'/'.$_POST["dropfolderfileform1"]; if(file_exists($fullfile)) { + /* Check if a local file is uploaded as well */ + if(isset($_FILES["userfile"]['error'][0])) { + if($_FILES["userfile"]['error'][0] != 0) + $_FILES["userfile"] = array(); + } $finfo = finfo_open(FILEINFO_MIME); $mimetype = explode(';', finfo_file($finfo, $fullfile)); $_FILES["userfile"]['tmp_name'][] = $fullfile;