Skip to content

Commit

Permalink
File extension check should be case insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vandemaele committed Oct 18, 2021
1 parent c7e7844 commit 2d68183
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Skeleton/Core/Web/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function has_known_extension() {

$known_extension = false;
foreach (self::$filetypes as $filetype => $extensions) {
if (in_array($pathinfo['extension'], $extensions)) {
if (in_array(strtolower($pathinfo['extension']), $extensions)) {
return true;
}
}
Expand All @@ -124,7 +124,7 @@ protected function get_path() {

// Add the media_path from the current application
foreach (self::$filetypes as $filetype => $extensions) {
if (!in_array($pathinfo['extension'], $extensions)) {
if (!in_array(strtolower($pathinfo['extension']), $extensions)) {
continue;
}
$filepaths[] = Application::get()->media_path . '/' . $filetype . '/' . $pathinfo['dirname'] . '/' . $pathinfo['basename'];
Expand All @@ -143,7 +143,7 @@ protected function get_path() {
}

foreach (self::$filetypes as $filetype => $extensions) {
if (!in_array($pathinfo['extension'], $extensions)) {
if (!in_array(strtolower($pathinfo['extension']), $extensions)) {
continue;
}

Expand Down

0 comments on commit 2d68183

Please sign in to comment.