Allow string path to be passed to Zotero.File.getExtension()

This commit is contained in:
Dan Stillman 2016-05-26 00:32:18 -04:00
parent 47b934f67e
commit 2f47eae3ff

View file

@ -77,6 +77,7 @@ Zotero.File = new function(){
}
function getExtension(file){
file = this.pathToFile(file);
var pos = file.leafName.lastIndexOf('.');
return pos==-1 ? '' : file.leafName.substr(pos+1);
}