diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-includes/js/wp-ajax-response.js --- a/wp/wp-includes/js/wp-ajax-response.js Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-includes/js/wp-ajax-response.js Tue Dec 15 13:49:49 2020 +0100 @@ -17,10 +17,10 @@ } return r; }, - parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission + parseAjaxResponse: function( x, r, e ) { // 1 = good, 0 = strange (bad data?), -1 = you lack permission. var parsed = {}, re = jQuery('#' + r).empty(), err = ''; - if ( x && typeof x == 'object' && x.getElementsByTagName('wp_ajax') ) { + if ( x && typeof x === 'object' && x.getElementsByTagName('wp_ajax') ) { parsed.responses = []; parsed.errors = false; jQuery('response', x).each( function() { @@ -51,7 +51,7 @@ } if ( isNaN(x) ) { return !re.html('

' + x + '

'); } x = parseInt(x,10); - if ( -1 == x ) { return !re.html('

' + wpAjax.noPerm + '

'); } + if ( -1 === x ) { return !re.html('

' + wpAjax.noPerm + '

'); } else if ( 0 === x ) { return !re.html('

' + wpAjax.broken + '

'); } return true; }, @@ -64,7 +64,7 @@ } }, wpAjax || { noPerm: 'Sorry, you are not allowed to do that.', broken: 'Something went wrong.' } ); -// Basic form validation +// Basic form validation. jQuery(document).ready( function($){ $('form.validate').submit( function() { return wpAjax.validateForm( $(this) ); } ); });