Fix impossibility to validate objects (#35202)

* Fix impossibility to validate objects

* fix pre commit

---------

Co-authored-by: Lucas Marcouiller <lmarcouiller@dolicloud.com>
This commit is contained in:
Lucas Marcouiller
2025-09-03 16:28:10 +02:00
committed by GitHub
parent 3ba272b2fb
commit 5fa3ecd41a
2 changed files with 4 additions and 0 deletions

View File

@@ -1569,6 +1569,9 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
}
// if (@file_exists($dirroot.'/'.$path)) {
if (@file_exists($dirroot . '/' . $path)) { // avoid [php:warn]
if ($key != 'main' && preg_match('/^core\//', $path)) { // When searching into an alternative custom path, we don't want path like 'core/...' because path should be 'modulename/core/...'
continue;
}
$res = $dirroot . '/' . $path;
return $res;
}