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
This commit is contained in:
westi 2012-03-29 13:13:13 +00:00
parent fabdd204c0
commit 1e62ff3689

View File

@ -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';