Skip to content

Commit

Permalink
Library Upload : Protect against empty default resize limit CMS setting.
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterMis committed Oct 19, 2023
1 parent 6a86718 commit 0bb03a1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions ui/src/core/file-upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function openUploadForm(options) {
uploadTemplate = Handlebars.compile($("#" + options.templateId).html());
}

if (typeof maxImagePixelSize === undefined || maxImagePixelSize === '') {
maxImagePixelSize = 0;
}

// Handle bars and open a dialog
var dialog = bootbox.dialog({
message: uploadTemplate(options.templateOptions),
Expand Down
2 changes: 1 addition & 1 deletion views/include-file-upload.twig
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

{# Max image resize size from settings #}
<script type="text/javascript">
const maxImagePixelSize = {{ settings.DEFAULT_RESIZE_LIMIT }};
let maxImagePixelSize = "{{ settings.DEFAULT_RESIZE_LIMIT }}";
</script>

{# Handlebars Templates #}
Expand Down

0 comments on commit 0bb03a1

Please sign in to comment.