Skip to content

Commit 4a7fbd7

Browse files
committed
Add validation
1 parent 4ef4c6c commit 4a7fbd7

File tree

1 file changed

+6
-0
lines changed
  • app/code/Magento/MediaGalleryMetadata/Model/Png/Segment

1 file changed

+6
-0
lines changed

app/code/Magento/MediaGalleryMetadata/Model/Png/Segment/ReadExif.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@ public function __construct(
3939
*/
4040
public function execute(FileInterface $file): MetadataInterface
4141
{
42+
if (!is_callable('exif_read_data')) {
43+
throw new LocalizedException(
44+
__('exif_read_data() must be enabled in php configuration')
45+
);
46+
}
47+
4248
foreach ($file->getSegments() as $segment) {
4349
if ($this->isExifSegment($segment)) {
4450
return $this->getExifData($segment);

0 commit comments

Comments
 (0)