WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/07/2009 06:01:02 PM (12 years ago)
Author:
westi
Message:

Check the correct global in get_page and also ensure that the cap check for deleting pages copes for the default page we edit when adding new. Fixes #11203.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/capabilities.php

    r12160 r12332  
    819819        //echo "current user id : $user_id, page author id: " . $page_author_data->ID . "<br />";
    820820        // If the user is the author...
     821
     822        if ('' != $page->post_author) {
     823            $page_author_data = get_userdata( $page->post_author );
     824        } else {
     825            //No author set yet so default to current user for cap checks
     826            $page_author_data = $author_data;
     827        }
     828
    821829        if ( $user_id == $page_author_data->ID ) {
    822830            // If the page is published...
Note: See TracChangeset for help on using the changeset viewer.