WordPress.org

Make WordPress Core

Changeset 20323


Ignore:
Timestamp:
03/29/2012 01:13:13 PM (6 years ago)
Author:
westi
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/class-wp-xmlrpc-server.php

    r20322 r20323  
    35383538                if ( $publish )
    35393539                    $cap  = 'publish_pages';
    3540                 elseif ('publish' == $content_struct['page_status'])
     3540                elseif ( isset( $content_struct['page_status'] ) && 'publish' == $content_struct['page_status'] )
    35413541                    $cap  = 'publish_pages';
    35423542                else
     
    35493549                if ( $publish )
    35503550                    $cap  = 'publish_posts';
    3551                 elseif ('publish' == $content_struct['post_status'])
     3551                elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'] )
    35523552                    $cap  = 'publish_posts';
    35533553                else
     
    35623562            if ( $publish )
    35633563                $cap  = 'publish_posts';
    3564             elseif ('publish' == $content_struct['post_status'])
     3564            elseif ( isset( $content_struct['post_status'] ) && 'publish' == $content_struct['post_status'])
    35653565                $cap  = 'publish_posts';
    35663566            else
Note: See TracChangeset for help on using the changeset viewer.