From 45cfe03be44df0583dbdb240bd2afcc5687dc304 Mon Sep 17 00:00:00 2001 From: Peter Westwood 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: https://develop.svn.wordpress.org/trunk@20323 602fd350-edb4-49c9-b593-d223f7449a82 --- 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';