diff --git a/third-party/projects/jquery-form/jquery.form.js b/third-party/projects/jquery-form/jquery.form.js index 591ad6f1fe..5daacca003 100644 --- a/third-party/projects/jquery-form/jquery.form.js +++ b/third-party/projects/jquery-form/jquery.form.js @@ -10,16 +10,9 @@ */ /*global ActiveXObject */ -// AMD support (function (factory) { "use strict"; - if (typeof define === 'function' && define.amd) { - // using AMD; register as anon module - define(['jquery'], factory); - } else { - // no AMD; invoke directly - factory( (typeof(jQuery) != 'undefined') ? jQuery : window.Zepto ); - } + factory(window.$ || window.Zepto); } (function($) { @@ -190,6 +183,15 @@ $.fn.ajaxSubmit = function(options) { var oldSuccess = options.success || function(){}; callbacks.push(function(data) { var fn = options.replaceTarget ? 'replaceWith' : 'html'; + + // Validate `data` through `HTML encoding` when passed + // `data` is passed to `html()`, as suggested in + // https://github.com/jquery-form/form/issues/464 + + data = options.replaceTarget + ? data + : $.parseHTML($('