mirror of
https://github.com/nextcloud/server.git
synced 2025-10-26 19:21:34 +00:00
Restrict EXIF extracting to a subset of formats
Signed-off-by: Louis Chemineau <louis@chmn.me>
This commit is contained in:
parent
157be42a83
commit
b67e34f78f
@ -44,11 +44,15 @@ class ExifProvider implements IMetadataProvider {
|
||||
return extension_loaded('exif');
|
||||
}
|
||||
|
||||
/** @return array{'gps': FileMetadata, 'size': FileMetadata} */
|
||||
/** @return array{'gps'?: FileMetadata, 'size'?: FileMetadata} */
|
||||
public function execute(File $file): array {
|
||||
$exifData = [];
|
||||
$fileDescriptor = $file->fopen('rb');
|
||||
|
||||
if ($fileDescriptor === false) {
|
||||
return [];
|
||||
}
|
||||
|
||||
$data = null;
|
||||
try {
|
||||
// Needed to make reading exif data reliable.
|
||||
@ -107,7 +111,7 @@ class ExifProvider implements IMetadataProvider {
|
||||
}
|
||||
|
||||
public static function getMimetypesSupported(): string {
|
||||
return '/image\/.*/';
|
||||
return '/image\/(png|jpeg|heif|webp|tiff)/';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
Reference in New Issue
Block a user