fix warning php 8.2

This commit is contained in:
John BOTELLA 2024-01-03 14:53:31 +01:00
parent 01c78a0aa5
commit d4d89b6bfb

View file

@ -1214,7 +1214,7 @@ class FormFile
}
}
// For backward compatiblity, we detect file stored into an old path
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO') && $filearray[0]['level1name'] == 'photos') {
if (getDolGlobalInt('PRODUCT_USE_OLD_PATH_FOR_PHOTO') && isset($filearray[0]) && $filearray[0]['level1name'] == 'photos') {
$relativepath = preg_replace('/^.*\/produit\//', '', $filearray[0]['path']).'/';
}