diff --git a/frontend/elements/photo-thumbnail.html b/frontend/elements/photo-thumbnail.html index be5e579..4f198d8 100755 --- a/frontend/elements/photo-thumbnail.html +++ b/frontend/elements/photo-thumbnail.html @@ -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) {