mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-01-06 17:13:03 +01:00
FIX #yogosha19628
This commit is contained in:
@@ -5628,7 +5628,9 @@ abstract class CommonObject
|
||||
$file = $prefix."_".$modele.".modules.php";
|
||||
}
|
||||
|
||||
// On verifie l'emplacement du modele
|
||||
$file = dol_sanitizeFileName($file);
|
||||
|
||||
// We chack if file exists
|
||||
$file = dol_buildpath($reldir.$modelspath.$file, 0);
|
||||
if (file_exists($file)) {
|
||||
$filefound = $file;
|
||||
@@ -5648,10 +5650,13 @@ abstract class CommonObject
|
||||
return -1;
|
||||
}
|
||||
|
||||
// If generator was found
|
||||
global $db; // Required to solve a conception default making an include of code using $db instead of $this->db just after.
|
||||
// Sanitize $filefound
|
||||
$filefound = dol_sanitizePathName($filefound);
|
||||
|
||||
require_once $file;
|
||||
// If generator was found
|
||||
global $db; // Required to solve a conception default making an include of some code that uses $db instead of $this->db just after.
|
||||
|
||||
require_once $filefound;
|
||||
|
||||
$obj = new $classname($this->db);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user