diff --git a/plinth/modules/jsxc/static/jsxc-plinth.js b/plinth/modules/jsxc/static/jsxc-plinth.js index cfbb9c14e..9654a98dd 100644 --- a/plinth/modules/jsxc/static/jsxc-plinth.js +++ b/plinth/modules/jsxc/static/jsxc-plinth.js @@ -43,6 +43,16 @@ # THE SOFTWARE. */ +// Provide compatibility with jQuery Core >= 3.5 by expanding HTML code similar +// to how it was done before jQuery Core < 3.5. This code was removed because it +// is potentially insecure when the HTML code being parsed is coming from the +// user input. See: https://jquery.com/upgrade-guide/3.5/ . JSXC >= 4.0 likely +// does not need this. +var rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([a-z][^\/\0>\x20\t\r\n\f]*)[^>]*)\/>/gi; +jQuery.htmlPrefilter = function(html) { + return html.replace(rxhtmlTag, "<$1>"); +}; + $(function() { const body = document.querySelector('body'); const root = body.getAttribute('data-jsxc-root'); @@ -93,12 +103,13 @@ $(function() { formElements.prop('disabled', true); $('.submit').hide(); $('.logout').show(); - } + }; + var logged_out_state = function() { formElements.prop('disabled', false); $('.submit').show(); $('.logout').hide(); - } + }; $(document).on('close.dialog.jsxc', function() { jsxc.debug('Event triggered close.dialog.jsxc');