[PHP 8.x] exif ModeArray field breaks picture page #1863

Closed
opened 2026-10-05 00:59:05 +02:00 by adam · 0 comments
Owner

When you have ModeArray in your list of EXIF fields to extract from the photo:

$conf['show_exif_fields'] = array(
'exif_field_Make'       => 'Make',
'exif_field_Model'       => 'Model',
'exif_field_ExposureTime'     => 'ExposureTime',
'exif_field_FocalLength'     => 'FocalLength', 
'exif_field_FNumber'       => 'FNumber',
'exif_field_ModeArray'       => 'ModeArray',
);

The ModeArray is an array, obviously, and it breaks PHP code because strip_tags breaks on an array with PHP 8:

Fatal error: Uncaught TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in include/functions_metadata.inc.php:190

Stack trace:
#0 include/functions_metadata.inc.php(190): strip_tags()
#1 include/picture_metadata.inc.php(24): get_exif_data()
#2 picture.php(1014): include('...')
#3 {main}
thrown in include/functions_metadata.inc.php on line 190

When you have `ModeArray` in your list of EXIF fields to extract from the photo: ``` $conf['show_exif_fields'] = array( 'exif_field_Make' => 'Make', 'exif_field_Model' => 'Model', 'exif_field_ExposureTime' => 'ExposureTime', 'exif_field_FocalLength' => 'FocalLength', 'exif_field_FNumber' => 'FNumber', 'exif_field_ModeArray' => 'ModeArray', ); ``` The `ModeArray` is an array, obviously, and it breaks PHP code because `strip_tags` breaks on an array with PHP 8: > Fatal error: Uncaught TypeError: strip_tags(): Argument #1 ($string) must be of type string, array given in include/functions_metadata.inc.php:190 > > Stack trace: > #0 include/functions_metadata.inc.php(190): strip_tags() > #1 include/picture_metadata.inc.php(24): get_exif_data() > #2 picture.php(1014): include('...') > #3 {main} > thrown in include/functions_metadata.inc.php on line 190 <!-- github-sync-id:2235247961 -->
adam closed this issue 2026-10-05 00:59:05 +02:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adam/Piwigo#1863