Skip to content

Commit

Permalink
MIR-1279 Consider file names continaing characters that need to be en…
Browse files Browse the repository at this point in the history
…coded in URLs
  • Loading branch information
toKrause committed Feb 14, 2024
1 parent 6207d4a commit bf4b7fb
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
data-derivateid="{{../mycorederivate}}"
data-objectid="{{../mycoreobject}}"
data-file="{{name}}"
data-path="{{path}}"
data-path="{{urlPath}}"
class="option mir_mainfile dropdown-item">
<span class="fas fa-star"></span>
{{getI18n "IFS.mainFile"}}
Expand All @@ -94,7 +94,7 @@
{{#if ../permDelete}}
{{#is type "file"}}
<li>
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&amp;objectid={{../mycoreobject}}&amp;todo=smovfile&amp;file={{path}}"
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&amp;objectid={{../mycoreobject}}&amp;todo=smovfile&amp;file={{urlPath}}"
class="option rename dropdown-item"
title="{{getI18n (concat "IFS." type "Rename")}}">
<span class="fas fa-file-signature"></span>
Expand All @@ -103,7 +103,7 @@
</li>
{{/is}}
<li>
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&amp;objectid={{../mycoreobject}}&amp;todo=sdelfile&amp;file={{path}}"
<a href="{{../serverBaseURL}}servlets/MCRDerivateServlet?derivateid={{../mycorederivate}}&amp;objectid={{../mycoreobject}}&amp;todo=sdelfile&amp;file={{urlPath}}"
class="option confirm_deletion dropdown-item"
data-text="{{getI18n (concat "mir.confirm." type ".text")}}"
title="{{getI18n (concat "IFS." type "Delete")}}">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@
directory = fileParam.substr(0, lastSlashInFile+1);
let oldName = fileParam.substr(directory.length);

let newName = prompt(i18nKeys["IFS.fileRename.to"], oldName);
let newName = prompt(i18nKeys["IFS.fileRename.to"], decodeURI(oldName));
if (newName == null) {
e.preventDefault();
} else {
Expand All @@ -428,7 +428,7 @@
if (lastSlashInName > 0) {
newName = newName.substr(lastSlashInName);
}
$(this).attr("href", href + "&file2=" + directory + newName);
$(this).attr("href", href + "&file2=" + directory + encodeURI(newName));
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion mir-module/src/main/resources/xsl/metadata/mir-viewer.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
<xsl:template name="loadViewer">
<xsl:param name="derivate" />
<xsl:param name="file" />
<script src="{$WebApplicationBaseURL}rsc/viewer/{$derivate}{$file}?embedded=true&amp;XSL.Style=js">
<script src="{$WebApplicationBaseURL}rsc/viewer/{$derivate}{mcrxsl:encodeURIPath($file)}?embedded=true&amp;XSL.Style=js">
</script>
</xsl:template>

Expand Down

0 comments on commit bf4b7fb

Please sign in to comment.