Fix: add filter in "dol_most_recent_files" for avoid conflict with
option "Save file on server with name "FA0700034_Original filename""
This commit is contained in:
parent
6a3310daf7
commit
5139954365
@ -2194,7 +2194,7 @@ if ($action == 'create')
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -2219,7 +2219,7 @@ if ($action == 'create')
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->propal->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -2285,7 +2285,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -2310,7 +2310,7 @@ if ($action == 'create' && $user->rights->commande->creer) {
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -3561,7 +3561,7 @@ if ($action == 'create')
|
||||
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -3586,7 +3586,7 @@ if ($action == 'create')
|
||||
dol_print_error($db, $result);
|
||||
exit();
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/'));
|
||||
$fileparams = dol_most_recent_file($conf->facture->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file = $fileparams ['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -1621,7 +1621,7 @@ else if ($id || $ref)
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -1648,7 +1648,7 @@ else if ($id || $ref)
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->expedition->dir_output . '/sending/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -1732,7 +1732,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -1759,7 +1759,7 @@ else if ($id > 0 || ! empty($ref))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->ficheinter->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -1920,7 +1920,7 @@ elseif (! empty($object->id))
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -1947,7 +1947,7 @@ elseif (! empty($object->id))
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->commande->dir_output . '/' . $ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
@ -2396,7 +2396,7 @@ else
|
||||
{
|
||||
$ref = dol_sanitizeFileName($object->ref);
|
||||
include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
|
||||
// Define output language
|
||||
@ -2423,7 +2423,7 @@ else
|
||||
dol_print_error($db,$result);
|
||||
exit;
|
||||
}
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref,'/'));
|
||||
$fileparams = dol_most_recent_file($conf->fournisseur->facture->dir_output.'/'.get_exdir($object->id,2).$ref, preg_quote($ref, '/').'\.([a-z0-9])+$');
|
||||
$file=$fileparams['fullname'];
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user