summaryrefslogtreecommitdiffstats
path: root/files
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2011-08-24 20:34:27 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2011-08-24 20:34:27 -0400
commit9353d1de7409d1f16ce194e64468b4ff1b46e8a9 (patch)
tree07624c7acacbc5d8d0bdfb0aacb8c1020da2fbd5 /files
parent46af991574a3bcec70cb6123f35eb85587d0e0c8 (diff)
downloadnextcloud-server-9353d1de7409d1f16ce194e64468b4ff1b46e8a9.tar.gz
nextcloud-server-9353d1de7409d1f16ce194e64468b4ff1b46e8a9.zip
Get file extension using lastIndexOf instead of indexOf in case there is a '.' in file name
Diffstat (limited to 'files')
-rw-r--r--files/js/filelist.js6
1 files changed, 3 insertions, 3 deletions
diff --git a/files/js/filelist.js b/files/js/filelist.js
index b89bc9b57b6..a776b7bce08 100644
--- a/files/js/filelist.js
+++ b/files/js/filelist.js
@@ -7,7 +7,7 @@ FileList={
var html='<tr data-file="'+name+'" data-type="file" data-size="'+size+'">';
if(name.indexOf('.')!=-1){
var basename=name.substr(0,name.indexOf('.'));
- var extention=name.substr(name.indexOf('.'));
+ var extention=name.substr(name.lastIndexOf('.'));
}else{
var basename=name;
var extention=false;
@@ -127,7 +127,7 @@ FileList={
tr.attr('data-file',newname);
td.children('a.name').empty();
if(newname.indexOf('.')>0){
- basename=newname.substr(0,newname.indexOf('.'));
+ basename=newname.substr(0,newname.lastIndexOf('.'));
}else{
basename=newname;
}
@@ -135,7 +135,7 @@ FileList={
span.text(basename);
td.children('a.name').append(span);
if(newname.indexOf('.')>0){
- span.append($('<span class="extention">'+newname.substr(newname.indexOf('.'))+'</span>'));
+ span.append($('<span class="extention">'+newname.substr(newname.lastIndexOf('.'))+'</span>'));
}
$.ajax({
url: 'ajax/rename.php',