From 182c409c587220ef60f9ce35fe22f84db1c0a346 Mon Sep 17 00:00:00 2001 From: ryan Date: Fri, 11 May 2007 21:40:15 +0000 Subject: [PATCH] Fix for PHP version 5.2.2 where isn't set. fixes #4248 for 2.2 git-svn-id: http://svn.automattic.com/wordpress/branches/2.2@5452 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/admin-functions.php | 2 +- xmlrpc.php | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/wp-admin/admin-functions.php b/wp-admin/admin-functions.php index 4ee8b1acd9..373368f0c6 100644 --- a/wp-admin/admin-functions.php +++ b/wp-admin/admin-functions.php @@ -1915,7 +1915,7 @@ function wp_handle_upload( &$file, $overrides = false ) { // A successful upload will pass this test. It makes no sense to override this one. if ( $file['error'] > 0 ) return $upload_error_handler( $file, $upload_error_strings[$file['error']] ); - + error_log(var_export($file, true), 3, '/tmp/loggit'); // A non-empty file will pass this test. if ( $test_size && !($file['size'] > 0 ) ) return $upload_error_handler( $file, __( 'File is empty. Please upload something more substantial.' )); diff --git a/xmlrpc.php b/xmlrpc.php index 2f4220aee4..1294cb59fd 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -5,6 +5,12 @@ define('XMLRPC_REQUEST', true); // Some browser-embedded clients send cookies. We don't want them. $_COOKIE = array(); +// A bug in PHP < 5.2.2 makes $HTTP_RAW_POST_DATA not set by default, +// but we can do it ourself. +if ( !isset( $HTTP_RAW_POST_DATA ) ) { + $HTTP_RAW_POST_DATA = file_get_contents( 'php://input' ); +} + # fix for mozBlog and other cases where '