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

git-svn-id: https://develop.svn.wordpress.org/trunk@19362 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2011-11-20 01:10:50 +00:00
parent 2ac5299c17
commit 50a35b02b6
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.