File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
modules/apps/frontend-js/frontend-js-jquery-web/src/main/resources/META-INF/resources/jquery Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 243243 var oldSuccess = options . success || function ( ) { } ;
244244 callbacks . push ( function ( data ) {
245245 var fn = options . replaceTarget ? 'replaceWith' : 'html' ;
246+
247+ // Validate `data` through `HTML encoding` when passed `data` is passed
248+ // to `html()`, as suggested in https://github.com/jquery-form/form/issues/464
249+ fn == 'html' ? data = $ . parseHTML ( $ ( "<div>" ) . text ( data ) . html ( ) ) : '' ;
250+
246251 $ ( options . target ) [ fn ] ( data ) . each ( oldSuccess , arguments ) ;
247252 } ) ;
248253 }
10761081 var parseJSON =
10771082 $ . parseJSON ||
10781083 function ( s ) {
1079- /*jslint evil:true */
1080- return window [ 'eval' ] ( '(' + s + ')' ) ;
1084+
1085+ // Arise an error resolvable including jquery instead of
1086+ // making a new function using unsanitized inputs
1087+
1088+ window . console . error ( 'jquery.parseJSON is undefined' ) ;
1089+ return null ;
10811090 } ;
10821091
10831092 var httpData = function ( xhr , type , s ) {
You can’t perform that action at this time.
0 commit comments