You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This line (638) in URI's isDirectory method: return (_path.charAt(path.length - 1) == '/');
should be return (_path.charAt(_path.length - 1) == '/');
Since field_path is escaped but propertypath is not, for every URI that has escaped characters, charAt will pick a character somewhere in the middle of the string (not at the end) and then see if that character is a slash--which it might be. When that happens, isDirectory returns the wrong result, breaking in turn getFilename, getExtension and isOfFileType methods.
This code: var u:URI = new URI(); u.unknownToURI("C:\\a b c d\\ab.swf"); trace(u.toString() + " isDir=" + u.isDirectory());
yields http://c/a%20b%20c%20d/ab.swf isDir=true
I don't have permissions to commit the fix.
The text was updated successfully, but these errors were encountered:
sangupta
added a commit
to sangupta/as3corelib
that referenced
this issue
Apr 30, 2012
This line (638) in URI's isDirectory method:
return (_path.charAt(path.length - 1) == '/');
should be
return (_path.charAt(_path.length - 1) == '/');
Since field
_path
is escaped but propertypath
is not, for every URI that has escaped characters, charAt will pick a character somewhere in the middle of the string (not at the end) and then see if that character is a slash--which it might be. When that happens, isDirectory returns the wrong result, breaking in turn getFilename, getExtension and isOfFileType methods.This code:
var u:URI = new URI(); u.unknownToURI("C:\\a b c d\\ab.swf"); trace(u.toString() + " isDir=" + u.isDirectory());
yields
http://c/a%20b%20c%20d/ab.swf isDir=true
I don't have permissions to commit the fix.
The text was updated successfully, but these errors were encountered: