Fix: send $varfiles instead _FILES
This commit is contained in:
parent
e725ef0eef
commit
b6dc20fb90
@ -565,11 +565,11 @@ function dol_unescapefile($filename)
|
|||||||
* @param int $disablevirusscan 1=Disable virus scan
|
* @param int $disablevirusscan 1=Disable virus scan
|
||||||
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
* @param string $uploaderrorcode Value of PHP upload error code ($_FILES['field']['error'])
|
||||||
* @param int $notrigger Disable all triggers
|
* @param int $notrigger Disable all triggers
|
||||||
* @param array $uploaded_file Values of uploaded file ($_FILES['field'])
|
* @param string $varfiles _FILES var name
|
||||||
* @return int >0 if OK, <0 or string if KO
|
* @return int >0 if OK, <0 or string if KO
|
||||||
* @see dolCheckUploadedFile, dol_move
|
* @see dolCheckUploadedFile, dol_move
|
||||||
*/
|
*/
|
||||||
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0, $uploaded_file=null)
|
function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disablevirusscan=0, $uploaderrorcode=0, $notrigger=0, $varfiles='addedfile')
|
||||||
{
|
{
|
||||||
global $db, $hookmanager;
|
global $db, $hookmanager;
|
||||||
global $object;
|
global $object;
|
||||||
@ -590,7 +590,7 @@ function dol_move_uploaded_file($src_file, $dest_file, $allowoverwrite, $disable
|
|||||||
}
|
}
|
||||||
$hookmanager->initHooks(array('fileslib'));
|
$hookmanager->initHooks(array('fileslib'));
|
||||||
|
|
||||||
$parameters=array('dest_file' => $dest_file, 'uploaded_file' => $uploaded_file, 'allowoverwrite' => $allowoverwrite, 'notrigger' => $notrigger);
|
$parameters=array('dest_file' => $dest_file, 'varfiles' => $varfiles, 'allowoverwrite' => $allowoverwrite, 'notrigger' => $notrigger);
|
||||||
$reshook=$hookmanager->executeHooks('dolMoveUploadedFile', $parameters, $object);
|
$reshook=$hookmanager->executeHooks('dolMoveUploadedFile', $parameters, $object);
|
||||||
|
|
||||||
if (empty($reshook)) {
|
if (empty($reshook)) {
|
||||||
@ -1051,7 +1051,7 @@ function dol_add_file_process($upload_dir,$allowoverwrite=0,$donotupdatesession=
|
|||||||
{
|
{
|
||||||
if (dol_mkdir($upload_dir) >= 0)
|
if (dol_mkdir($upload_dir) >= 0)
|
||||||
{
|
{
|
||||||
$resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $upload_dir . "/" . $_FILES[$varfiles]['name'], $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $_FILES[$varfiles]);
|
$resupload = dol_move_uploaded_file($_FILES[$varfiles]['tmp_name'], $upload_dir . "/" . $_FILES[$varfiles]['name'], $allowoverwrite, 0, $_FILES[$varfiles]['error'], 0, $varfiles);
|
||||||
if (is_numeric($resupload) && $resupload > 0)
|
if (is_numeric($resupload) && $resupload > 0)
|
||||||
{
|
{
|
||||||
if (empty($donotupdatesession))
|
if (empty($donotupdatesession))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user