Fixes problems with thumbnails for filenames with single and double quotes.

This commit is contained in:
Lars Jung 2012-02-17 11:28:08 +01:00
parent 42d3dfe80e
commit d56d0716cb
2 changed files with 4 additions and 3 deletions

View file

@ -37,7 +37,7 @@ h5ai is provided under the terms of the [MIT License](http://github.com/lrsjng/h
* fixes include problems in PHP version
* fixes path problems on servers running on Windows in PHP version
* fixes broken links in custom headers/footers while zipped download enabled
* fixes problems with thumbnails for files with single or double quotes in filename
### v0.17 - *2011-11-28*

View file

@ -74,8 +74,9 @@
if (H5AI.core.settings.showThumbs === true && $.inArray(path.type, thumbTypes) >= 0) {
imgClass = "class='thumb'";
icon16 = H5AI.core.api() + "?action=thumb&href=" + path.absHref + "&width=16&height=16&mode=square";
icon48 = H5AI.core.api() + "?action=thumb&href=" + path.absHref + "&width=96&height=46&mode=rational";
var escapedHref = path.absHref.replace(/'/g, "%27").replace(/"/g, "%22");
icon16 = H5AI.core.api() + "?action=thumb&href=" + escapedHref + "&width=16&height=16&mode=square";
icon48 = H5AI.core.api() + "?action=thumb&href=" + escapedHref + "&width=96&height=46&mode=rational";
}
$label = $("<span class='label'>" + path.label + "</span>");