From 7a5edd0aec1fe22c62a300e83194623a19094594 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Thu, 1 Dec 2016 17:07:01 -0500 Subject: [PATCH] CRM-19709 - Fix html output in Common.js --- js/Common.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/js/Common.js b/js/Common.js index 68592f040f..5969aa270e 100644 --- a/js/Common.js +++ b/js/Common.js @@ -460,9 +460,9 @@ if (!CRM.vars) CRM.vars = {}; minimumInputLength: 1, formatResult: CRM.utils.formatSelect2Result, formatSelection: function(row) { - return (row.prefix !== undefined ? row.prefix + ' ' : '') + row.label + (row.suffix !== undefined ? ' ' + row.suffix : ''); + return _.escape((row.prefix !== undefined ? row.prefix + ' ' : '') + row.label + (row.suffix !== undefined ? ' ' + row.suffix : '')); }, - escapeMarkup: function (m) {return m;}, + escapeMarkup: _.identity, initSelection: function($el, callback) { var multiple = !!$el.data('select-params').multiple, @@ -639,7 +639,7 @@ if (!CRM.vars) CRM.vars = {}; type = hasDatepicker ? 'text' : 'number'; if (settings.allowClear !== undefined ? settings.allowClear : !$dataField.is('.required, [required]')) { - $clearLink = $('') + $clearLink = $('') .insertAfter($dataField); } if (settings.time !== false) { @@ -795,11 +795,11 @@ if (!CRM.vars) CRM.vars = {}; markup += '
'; } markup += '
' + - (row.prefix !== undefined ? row.prefix + ' ' : '') + row.label + (row.suffix !== undefined ? ' ' + row.suffix : '') + + _.escape((row.prefix !== undefined ? row.prefix + ' ' : '') + row.label + (row.suffix !== undefined ? ' ' + row.suffix : '')) + '
' + '
'; $.each(row.description || [], function(k, text) { - markup += '

' + text + '

'; + markup += '

' + _.escape(text) + '

'; }); markup += '
'; return markup; @@ -835,7 +835,7 @@ if (!CRM.vars) CRM.vars = {}; if (icon) { markup += ' '; } - markup += link.label + ''; + markup += _.escape(link.label) + ''; }); markup += ''; return markup; @@ -875,7 +875,7 @@ if (!CRM.vars) CRM.vars = {}; } var markup = '
' + '' + entityRefFilterValueMarkup(filter, filterSpec) + '
'; return markup; @@ -898,7 +898,7 @@ if (!CRM.vars) CRM.vars = {}; attrs += ' ' + attr + '="' + val + '"'; }); if (filterSpec.type === 'select') { - markup = ''; + markup = ''; if (filterSpec.options) { markup += CRM.utils.renderOptions(filterSpec.options, filter.value); } @@ -1041,7 +1041,7 @@ if (!CRM.vars) CRM.vars = {}; $el.parent().find('.ui-dialog-titlebar .ui-icon-closethick').removeClass('ui-icon-closethick').addClass('fa-times'); // Add resize button if ($el.parent().hasClass('crm-container') && $el.dialog('option', 'resizable')) { - $el.parent().find('.ui-dialog-titlebar').append($('