Skip to content
Snippets Groups Projects
Commit 7673a73a authored by Juanjo Menent's avatar Juanjo Menent
Browse files

Merge pull request #3939 from marcosgdf/bug-3836

FIX #3836 Unable to upload a document to an invoice under some circunstances
parents 8377d696 4a52d3c1
No related branches found
No related tags found
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
/* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net> /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2012-2013 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2012-2013 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2012 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -1041,6 +1042,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio ...@@ -1041,6 +1042,9 @@ function dol_add_file_process($upload_dir, $allowoverwrite=0, $donotupdatesessio
// Define $destpath (path to file including filename) and $destfile (only filename) // Define $destpath (path to file including filename) and $destfile (only filename)
$destpath=$upload_dir . "/" . $_FILES[$varfiles]['name']; $destpath=$upload_dir . "/" . $_FILES[$varfiles]['name'];
$destfile=$_FILES[$varfiles]['name']; $destfile=$_FILES[$varfiles]['name'];
$savingdocmask = dol_sanitizeFileName($savingdocmask);
if ($savingdocmask) if ($savingdocmask)
{ {
$destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask); $destpath=$upload_dir . "/" . preg_replace('/__file__/',$_FILES[$varfiles]['name'],$savingdocmask);
......
<?php <?php
/* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr> /* Copyright (C) 2013 Cédric Salvador <csalvador@gpcsolutions.fr>
* Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2013-2014 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -48,7 +49,7 @@ if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX)) ...@@ -48,7 +49,7 @@ if (empty($conf->global->MAIN_DISABLE_SUGGEST_REF_AS_PREFIX))
//var_dump($modulepart); //var_dump($modulepart);
if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task'))) if (in_array($modulepart,array('facture_fournisseur','commande_fournisseur','facture','commande','propal','ficheinter','contract','project','project_task')))
{ {
$savingdocmask=$object->ref.'-__file__'; $savingdocmask=dol_sanitizeFileName($object->ref).'-__file__';
} }
/*if (in_array($modulepart,array('member'))) /*if (in_array($modulepart,array('member')))
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment