Merge pull request #10873 from uberbrady/fix_dashboard

Don't crash JS when there are no data-export-options (as is true in Dashboard) Fixes #10872
This commit is contained in:
snipe 2022-03-27 07:21:34 +01:00 committed by GitHub
commit 70059f6f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,8 @@
}
$('.snipe-table').bootstrapTable('destroy').each(function () {
export_options = JSON.parse($(this).attr('data-export-options'));
data_export_options = $(this).attr('data-export-options');
export_options = data_export_options? JSON.parse(data_export_options): {};
export_options['htmlContent'] = true; //always enforce this on the given data-export-options (to prevent XSS)
$(this).bootstrapTable({