From 1e62ff368986d32c9224a090f71f5051209e75b7 Mon Sep 17 00:00:00 2001 From: westi Date: Thu, 29 Mar 2012 13:13:13 +0000 Subject: [PATCH] XMLRPC: In mw_newPost check to see if the post_status has been supplied before trying to use it to avoid undefined array access notices. Fixes #19774 props maxcutler. git-svn-id: http://svn.automattic.com/wordpress/trunk@20323 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/class-wp-xmlrpc-server.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/class-wp-xmlrpc-server.php b/wp-includes/class-wp-xmlrpc-server.php index 7bc881fffa..d937eb153e 100644 --- a/wp-includes/class-wp-xmlrpc-server.php +++ b/wp-includes/class-wp-xmlrpc-server.php @@ -3537,7 +3537,7 @@ class wp_xmlrpc_server extends IXR_Server { if ( $content_struct['post_type'] == 'page' ) { if ( $publish ) $cap = 'publish_pages'; - elseif ('publish' == $content_struct['page_status']) + elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] ) $cap = 'publish_pages'; else $cap = 'edit_pages'; @@ -3548,7 +3548,7 @@ class wp_xmlrpc_server extends IXR_Server { } elseif ( $content_struct['post_type'] == 'post' ) { if ( $publish ) $cap = 'publish_posts'; - elseif ('publish' == $content_struct['post_status']) + elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] ) $cap = 'publish_posts'; else $cap = 'edit_posts'; @@ -3561,7 +3561,7 @@ class wp_xmlrpc_server extends IXR_Server { } else { if ( $publish ) $cap = 'publish_posts'; - elseif ('publish' == $content_struct['post_status']) + elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status']) $cap = 'publish_posts'; else $cap = 'edit_posts';