From 2d3de629deb90819261abdc2751c0b74807f4c94 Mon Sep 17 00:00:00 2001 From: Dave Jenkins Date: Wed, 16 Dec 2015 14:49:19 +0000 Subject: [PATCH] CRM-17717 - send correct MIME type for .jpg files --- CRM/Contact/Page/ImageFile.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CRM/Contact/Page/ImageFile.php b/CRM/Contact/Page/ImageFile.php index c978901dcf..54d39a8ecc 100644 --- a/CRM/Contact/Page/ImageFile.php +++ b/CRM/Contact/Page/ImageFile.php @@ -60,9 +60,10 @@ class CRM_Contact_Page_ImageFile extends CRM_Core_Page { } if ($cid) { $config = CRM_Core_Config::singleton(); + $fileExtension = pathinfo($_GET['photo'], PATHINFO_EXTENSION); $this->download( $config->customFileUploadDir . $_GET['photo'], - 'image/' . pathinfo($_GET['photo'], PATHINFO_EXTENSION), + 'image/' . ($fileExtension == 'jpg' ? 'jpeg' : $fileExtension), $this->ttl ); CRM_Utils_System::civiExit(); -- 2.25.1