Fix remove warnings

This commit is contained in:
Laurent Destailleur
2023-08-14 23:09:40 +02:00
parent 865c712b55
commit 81e96f8787
4 changed files with 8 additions and 5 deletions

View File

@@ -1168,7 +1168,8 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
if ($key == 'main') {
continue;
}
if (file_exists($dirroot.'/'.$path)) {
// if (@file_exists($dirroot.'/'.$path)) {
if (@file_exists($dirroot.'/'.$path)) { // avoid [php:warn]
$res = $dirroot.'/'.$path;
return $res;
}
@@ -1215,7 +1216,8 @@ function dol_buildpath($path, $type = 0, $returnemptyifnotfound = 0)
preg_match('/^([^\?]+(\.css\.php|\.css|\.js\.php|\.js|\.png|\.jpg|\.php)?)/i', $path, $regs); // Take part before '?'
if (!empty($regs[1])) {
//print $key.'-'.$dirroot.'/'.$path.'-'.$conf->file->dol_url_root[$type].'<br>'."\n";
if (file_exists($dirroot.'/'.$regs[1])) {
//if (file_exists($dirroot.'/'.$regs[1])) {
if (@file_exists($dirroot.'/'.$regs[1])) { // avoid [php:warn]
if ($type == 1) {
$res = (preg_match('/^http/i', $conf->file->dol_url_root[$key]) ? '' : DOL_URL_ROOT).$conf->file->dol_url_root[$key].'/'.$path;
}