Fix ' in filenames

Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
James Ketr 2018-09-12 23:51:50 -07:00
parent ae32dd74c5
commit 3b8e149922

View File

@ -84,7 +84,7 @@
thumbChanged: function(thumbpath, visible) {
if (visible) {
this.style.backgroundImage = "url(" + thumbpath + ")";
this.style.backgroundImage = "url(" + encodeURI(thumbpath).replace(/'/g, "\\'") + ")";
} else {
this.style.backgroundImage = "";
}
@ -96,7 +96,10 @@
},
safeItemThumbFilepath: function(item, base) {
return "'" + (base + encodeURI(item.path) + "/thumbs/" + encodeURI(item.filename)).replace(/'/, "\\'") + "'";
if (!item || !base || !item.path) {
return "";
}
return base + item.path + "/thumbs/" + item.filename;
},
date: function(item) {