Skip to content

Commit

Permalink
Merge pull request #14554 from totten/5.14-JPG
Browse files Browse the repository at this point in the history
(dev/core#1044) Extension/MIME matching should be case insensitive
  • Loading branch information
eileenmcnaughton authored Jun 16, 2019
2 parents af9348d + caf7bcd commit 868c55c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CRM/Core/Page/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function run() {
}
$extension = CRM_Utils_File::getExtensionFromPath($path);
$candidateExtensions = CRM_Utils_File::getAcceptableExtensionsForMimeType($passedInMimeType);
if (!in_array($extension, $candidateExtensions)) {
if (!in_array(strtolower($extension), array_map('strtolower', $candidateExtensions))) {
throw new CRM_Core_Exception("Supplied mime-type does not match file extension");
}
// Now that we have validated mime-type supplied as much as possible lets now set the MimeType variable/
Expand Down

0 comments on commit 868c55c

Please sign in to comment.