From 3a73760d967edab137fe8eae20fdf63967be9ecf 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 Conflicts: js/Common.js --- js/Common.js | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/js/Common.js b/js/Common.js index 6b6fc03faa..c51462e90f 100644 --- a/js/Common.js +++ b/js/Common.js @@ -445,9 +445,9 @@ CRM.strings = CRM.strings || {}; 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, @@ -607,7 +607,7 @@ CRM.strings = CRM.strings || {}; $clearLink = $(); if (settings.allowClear !== undefined ? settings.allowClear : !$dataField.is('.required, [required]')) { - $clearLink = $('') + $clearLink = $('') .insertAfter($dataField); } if (settings.time !== false) { @@ -690,11 +690,11 @@ CRM.strings = CRM.strings || {}; 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; @@ -716,7 +716,7 @@ CRM.strings = CRM.strings || {}; if (link.type) { markup += ' '; } - markup += link.label + ''; + markup += _.escape(link.label) + ''; }); markup += ''; return markup; @@ -753,11 +753,11 @@ CRM.strings = CRM.strings || {}; } var markup = '
' + '   ' + '