Var not defined

This commit is contained in:
Laurent Destailleur 2020-04-23 13:35:40 +02:00
parent 72c6ac1c72
commit 86928efb95

View File

@ -971,6 +971,7 @@ class FormFile
// Get object entity
if (!empty($conf->multicompany->enabled))
{
$regs = array();
preg_match('/\/([0-9]+)\/[^\/]+\/'.preg_quote($modulesubdir, '/').'$/', $filedir, $regs);
$entity = ((!empty($regs[1]) && $regs[1] > 1) ? $regs[1] : 1); // If entity id not found in $filedir this is entity 1 by default
}