From 718f93c066bdcb4ea3783a89fffb1a59199391f5 Mon Sep 17 00:00:00 2001 From: JS Moore Date: Wed, 24 Jan 2024 09:33:20 -0500 Subject: [PATCH] Just because an array key doesn't imply the value at that key isn't null. Fixes nextcloud/photos#2225. Signed-off-by: JS Moore --- lib/Listener/OriginalDateTimeMetadataProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Listener/OriginalDateTimeMetadataProvider.php b/lib/Listener/OriginalDateTimeMetadataProvider.php index 5582364e5..d41579f34 100644 --- a/lib/Listener/OriginalDateTimeMetadataProvider.php +++ b/lib/Listener/OriginalDateTimeMetadataProvider.php @@ -93,7 +93,7 @@ public function handle(Event $event): void { $metadata = $event->getMetadata(); // Try to use EXIF data. - if ($metadata->hasKey('photos-exif') && array_key_exists('DateTimeOriginal', $metadata->getArray('photos-exif'))) { + if ($metadata->hasKey('photos-exif') && !empty($metadata->getArray('photos-exif')['DateTimeOriginal'])) { $rawDateTimeOriginal = $metadata->getArray('photos-exif')['DateTimeOriginal']; $timestampOriginal = $this->dateToTimestamp("Y:m:d G:i:s", $rawDateTimeOriginal, $node); if ($timestampOriginal !== false) {