Skip to content
This repository has been archived by the owner on Feb 23, 2021. It is now read-only.

KcFinder 2.x fix for broken thumbnails when file/folder contains single quotes #130

Open
wants to merge 1 commit into
base: 2.x
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions js/browser/files.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ browser.showFiles = function(callBack, selected) {
if (!icon.length) icon = '.';
icon = 'themes/' + browser.theme + '/img/files/big/' + icon + '.png';
}
// The icon URL will fail if the file or folder contains single quotes, so we'll escape them here
icon = icon.replace(/'/g, "\\'");
html += '<div class="file">' +
'<div class="thumb" style="background-image:url(\'' + icon + '\')" ></div>' +
'<div class="name">' + _.htmlData(file.name) + '</div>' +
Expand Down