This repository was archived by the owner on Dec 6, 2023. It is now read-only.
Extension case sensitivity fix#3
Merged
rogeriotaques merged 4 commits intorogeriotaques:masterfrom Jan 24, 2017
tkrn:master
Merged
Extension case sensitivity fix#3rogeriotaques merged 4 commits intorogeriotaques:masterfrom tkrn:master
rogeriotaques merged 4 commits intorogeriotaques:masterfrom
tkrn:master
Conversation
rogeriotaques
suggested changes
Jan 18, 2017
src/droparea.js
Outdated
| if ( o.accepted !== null && typeof o.accepted != 'boolean' ) | ||
| { | ||
| if ( o.accepted.indexOf( file.name.substr( file.name.lastIndexOf('.') ) ) === -1 ) | ||
| if ( o.accepted.indexOf( file.name.substr( file.name.lastIndexOf('.') ).toLowerCase() ) === -1 ) |
Owner
There was a problem hiding this comment.
Hi @tkrn ,
Thank you for your contribution. 👍
What do you think to lower-case the o.accepted as well, when comparing to name.lastIndexOf('.').toLowerCase()? By doing that, we can ensure that accepted extensions are aways in lower-case too.
Can you add it to your code?
if ( o.accepted.toLowerCase().indexOf( file.name.substr( file.name.lastIndexOf('.') ).toLowerCase() ) === -1 )
Cheers,
Roger.
Contributor
Author
|
Will do. Then I'll submit a pull request. Good feedback. Thanks!
On Jan 18, 2017, at 3:32 PM, Rog?rio Taques <notifications@github.com<mailto:notifications@github.com>> wrote:
@rogeriotaques requested changes on this pull request.
________________________________
In src/droparea.js<#3 (review)>:
@@ -203,7 +203,7 @@
// check if dropped file is allowed
if ( o.accepted !== null && typeof o.accepted != 'boolean' )
{
- if ( o.accepted.indexOf( file.name.substr( file.name.lastIndexOf('.') ) ) === -1 )
+ if ( o.accepted.indexOf( file.name.substr( file.name.lastIndexOf('.') ).toLowerCase() ) === -1 )
Hi @tkrn<https://github.com/tkrn> ,
Thank you for your contribution. ?
What do you think to lower-case the o.accepted as well, when comparing to name.lastIndexOf('.').toLowerCase()? By doing that, we can ensure that accepted extensions are aways in lower-case too.
Can you add it to your code?
if ( o.accepted.toLowerCase().indexOf( file.name.substr( file.name.lastIndexOf('.') ).toLowerCase() ) === -1 )
Cheers,
Roger.
-
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#3 (review)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AESMg-eZKH0R9lpOmd8-m349ZERa7PLCks5rTnbkgaJpZM4LmWTA>.
|
rogeriotaques
approved these changes
Jan 24, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.