WordPress.org

Make WordPress Core

Changeset 40424 for trunk


Ignore:
Timestamp:
04/13/2017 11:08:03 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Posts, Post Types: In wp_check_post_lock(), check if the user with lock exists and return false otherwise.

Props arshidkv12, 1naveengiri.
Fixes #39888.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/post.php

    r40423 r40424  
    14511451 * @param int $post_id ID of the post to check for editing.
    14521452 * @return int|false ID of the user with lock. False if the post does not exist, post is not locked,
    1453  *                   or post is locked by current user.
     1453 *                   the user with lock does not exist, or the post is locked by current user.
    14541454 */
    14551455function wp_check_post_lock( $post_id ) {
     
    14661466    $user = isset( $lock[1] ) ? $lock[1] : get_post_meta( $post->ID, '_edit_last', true );
    14671467
     1468    if ( ! get_userdata( $user ) ) {
     1469        return false;
     1470    }
     1471
    14681472    /** This filter is documented in wp-admin/includes/ajax-actions.php */
    14691473    $time_window = apply_filters( 'wp_check_post_lock_window', 150 );
     
    14821486 *
    14831487 * @param int $post_id ID of the post being edited.
    1484  * @return array|false Array of the lock time and user ID. False if the post does not exist or there
    1485  *                     is no current user.
     1488 * @return array|false Array of the lock time and user ID. False if the post does not exist, or
     1489 *                     there is no current user.
    14861490 */
    14871491function wp_set_post_lock( $post_id ) {
Note: See TracChangeset for help on using the changeset viewer.