Skip to content

Commit

Permalink
[pocketbase#1707] case-insensitive filename extension check
Browse files Browse the repository at this point in the history
Co-authored-by: HarryTr <[email protected]>
  • Loading branch information
hungcrush and harryoppa authored Jan 29, 2023
1 parent f01f1df commit 2c9e899
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ui/src/utils/CommonHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ export default class CommonHelper {
* @return {Boolean}
*/
static hasImageExtension(filename) {
return !!imageExtensions.find((ext) => filename.endsWith(ext));
return !!imageExtensions.find((ext) => filename.toLowerCase().endsWith(ext));
}

/**
Expand All @@ -744,7 +744,7 @@ export default class CommonHelper {
* @return {Boolean}
*/
static hasVideoExtension(filename) {
return !!videoExtensions.find((ext) => filename.endsWith(ext));
return !!videoExtensions.find((ext) => filename.toLowerCase().endsWith(ext));
}

/**
Expand All @@ -754,7 +754,7 @@ export default class CommonHelper {
* @return {Boolean}
*/
static hasAudioExtension(filename) {
return !!audioExtensions.find((ext) => filename.endsWith(ext));
return !!audioExtensions.find((ext) => filename.toLowerCase().endsWith(ext));
}

/**
Expand All @@ -764,7 +764,7 @@ export default class CommonHelper {
* @return {Boolean}
*/
static hasDocumentExtension(filename) {
return !!documentExtensions.find((ext) => filename.endsWith(ext));
return !!documentExtensions.find((ext) => filename.toLowerCase().endsWith(ext));
}

/**
Expand Down

0 comments on commit 2c9e899

Please sign in to comment.