Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Small bug in SingleFileLoader with getting file extension #463

Closed
adzhikemalov opened this issue Jan 16, 2013 · 1 comment
Closed

Small bug in SingleFileLoader with getting file extension #463

adzhikemalov opened this issue Jan 16, 2013 · 1 comment
Assignees
Labels

Comments

@adzhikemalov
Copy link

Problem in this function
private function decomposeFilename(url : String) : void
{
var base : String;
var i : int = url.lastIndexOf('.');

// Get rid of query string if any and extract suffix
base = (url.indexOf('?')>0)? url.split('?')[0] : url;
_fileExtension = base.substr(i + 1).toLowerCase();
_fileName = base.substr(0, i);
}
im using hashsum with floating point like 0.70
and in that case _fileExtension will be "" because url.lastIndexOf('.') is wrong

i fixed it with that changes
private function decomposeFilename(url : String) : void
{
var base : String;

// Get rid of query string if any and extract suffix
base = (url.indexOf('?')>0)? url.split('?')[0] : url;
var i : int = base.lastIndexOf('.');
_fileExtension = base.substr(i + 1).toLowerCase();
_fileName = base.substr(0, i);
}

@ghost ghost assigned ringodotnl Mar 22, 2013
rob-bateman added a commit that referenced this issue Apr 26, 2013
@rob-bateman
Copy link
Member

Good catch! fixed in commit 4dee4f1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants