mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-22 08:11:52 +01:00
Trim leading whitespace from AJAX responses.
This fixes the warning "$(html) HTML strings must start with '<' character" by jQuery Migrate when adding nav menu items, post custom fields or comment replies. fixes #23681. Built from https://develop.svn.wordpress.org/trunk@25546 git-svn-id: http://core.svn.wordpress.org/trunk@25466 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
1998919ade
commit
c2739d12cc
@ -495,7 +495,6 @@ commentReply = {
|
||||
t.revert();
|
||||
|
||||
r = r.responses[0];
|
||||
c = r.data;
|
||||
id = '#comment-' + r.id;
|
||||
|
||||
if ( 'edit-comment' == t.act )
|
||||
@ -513,8 +512,10 @@ commentReply = {
|
||||
}
|
||||
}
|
||||
|
||||
c = $.trim(r.data); // Trim leading whitespaces
|
||||
$(c).hide()
|
||||
$('#replyrow').after(c);
|
||||
|
||||
id = $(id);
|
||||
t.addEvents(id);
|
||||
bg = id.hasClass('unapproved') ? '#FFFFE0' : id.closest('.widefat, .postbox').css('backgroundColor');
|
||||
|
2
wp-admin/js/edit-comments.min.js
vendored
2
wp-admin/js/edit-comments.min.js
vendored
File diff suppressed because one or more lines are too long
@ -902,12 +902,16 @@ var wpNavMenu;
|
||||
|
||||
$.post( ajaxurl, params, function(menuMarkup) {
|
||||
var ins = $('#menu-instructions');
|
||||
|
||||
menuMarkup = $.trim( menuMarkup ); // Trim leading whitespaces
|
||||
processMethod(menuMarkup, params);
|
||||
|
||||
// Make it stand out a bit more visually, by adding a fadeIn
|
||||
$( 'li.pending' ).hide().fadeIn('slow');
|
||||
$( '.drag-instructions' ).show();
|
||||
if( ! ins.hasClass( 'menu-instructions-inactive' ) && ins.siblings().length )
|
||||
ins.addClass( 'menu-instructions-inactive' );
|
||||
|
||||
callback();
|
||||
});
|
||||
},
|
||||
|
2
wp-admin/js/nav-menu.min.js
vendored
2
wp-admin/js/nav-menu.min.js
vendored
File diff suppressed because one or more lines are too long
@ -208,7 +208,7 @@ wpList = {
|
||||
s.delAfter( rres, _s );
|
||||
}).dequeue();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
$.ajax( s );
|
||||
return false;
|
||||
@ -308,7 +308,7 @@ wpList = {
|
||||
},
|
||||
|
||||
add: function( e, s ) {
|
||||
e = $(e);
|
||||
e = $( $.trim(e) ); // Trim leading whitespaces
|
||||
|
||||
var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
|
||||
|
||||
|
2
wp-includes/js/wp-lists.min.js
vendored
2
wp-includes/js/wp-lists.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Reference in New Issue
Block a user