Merge pull request #27287 from atm-john/19.0_fix_warning_php8.2

fix warning php 8.2
This commit is contained in:
Laurent Destailleur 2024-01-03 16:03:50 +01:00 committed by GitHub
commit a95d6604b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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']).'/';
}