Fix return value in Plupload when using the html4 runtime, fixes #19302

git-svn-id: http://svn.automattic.com/wordpress/trunk@19362 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
azaozz 2011-11-20 01:10:50 +00:00
parent c65d96de08
commit 5866295242
3 changed files with 5 additions and 2 deletions

View File

@ -77,6 +77,9 @@ function updateMediaForm() {
function uploadSuccess(fileObj, serverData) {
var item = jQuery('#media-item-' + fileObj.id);
// on success serverData should be numeric, fix bug in html4 runtime returning the serverData wrapped in a <pre> tag
serverData = serverData.replace(/^<pre>(\d+)<\/pre>$/, '$1');
// if async-upload returned an error message, place it in the media item div and return
if ( serverData.match('media-upload-error') ) {
item.html(serverData);

File diff suppressed because one or more lines are too long

View File

@ -222,7 +222,7 @@ function wp_default_scripts( &$scripts ) {
// cannot use the plupload.full.js, as it loads browserplus init JS from Yahoo
$scripts->add( 'plupload-all', false, array('plupload', 'plupload-html5', 'plupload-flash', 'plupload-silverlight', 'plupload-html4'), '1511-20111112');
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111118');
$scripts->add( 'plupload-handlers', "/wp-includes/js/plupload/handlers$suffix.js", array('plupload-all', 'jquery'), '20111119');
$scripts->localize( 'plupload-handlers', 'pluploadL10n', $uploader_l10n );
// keep 'swfupload' for back-compat.