Skip to content
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
tkrn:master
Jan 24, 2017
Merged

Extension case sensitivity fix#3
rogeriotaques merged 4 commits intorogeriotaques:masterfrom
tkrn:master

Conversation

@tkrn
Copy link
Copy Markdown
Contributor

@tkrn tkrn commented Jan 18, 2017

No description provided.

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 )
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@tkrn
Copy link
Copy Markdown
Contributor Author

tkrn commented Jan 18, 2017 via email

@rogeriotaques rogeriotaques merged commit a1ae024 into rogeriotaques:master Jan 24, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants