[wp-hackers] Bug in wp_upload_bits?

Steve Winton stevewinton at gmail.com
Mon Nov 27 17:44:47 GMT 2006


Howdy folks

I've been playing around with XML-RPC calls today, trying to upload a
new media object (i.e. an MP3 file) using the
metaWeblog.newMediaObject procedure, and I think I may have stumbled
across a bug.

Basically the content of the media file being uploaded needs to be
base64 encoded at the client end, but at the server end,
wp_upload_bits isn't base64-decoding the content again.

I'm using WP 2.0.5, and the following fix, on line 957 of
functions-post.php works for me:

	$success = @ fwrite($ifp, base64_decode($bits));

Any thoughts/comments on this change?

Thanks,
Steve


More information about the wp-hackers mailing list