Making WordPress.org


Ignore:
Timestamp:
05/23/2023 06:23:01 AM (3 years ago)
Author:
dd32
Message:

Theme Directory: Clarify the permission check to be more readable.

[12600] incorrectly altered how the permission check operates, inverting it accidentally.

$post->post_author is a stringy ID, while $user->ID is an integer, causing the check to originally fail.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/theme-directory/admin-edit.php

    r12600 r12601  
    107107
    108108            // User must be able to edit theme or be the theme owner.
    109             if ( ! ( user_can( $user->ID, 'edit_post', $post ) || $user->ID !== $post->post_author ) ) {
     109            if ( ! user_can( $user->ID, 'edit_post', $post ) && $user->ID !== intval( $post->post_author ) ) {
    110110                return [ 'do_not_allow' ];
    111111            }
Note: See TracChangeset for help on using the changeset viewer.