Making WordPress.org


Ignore:
Timestamp:
08/29/2023 08:08:09 PM (3 years ago)
Author:
coffee2code
Message:

Photo Directory, Moderation: Check that array index is valid before use.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/plugins/photo-directory/inc/moderation.php

    r12792 r12869  
    218218         public static function disable_own_post_editing( $caps, $cap, $args, $user ) {
    219219                // Bail if not a relevant capability.
    220                 if ( ! in_array( $cap[0], [ 'edit_photos', 'publish_photos' ] ) ) {
     220                if ( empty( $cap[0] ) || ! in_array( $cap[0], [ 'edit_photos', 'publish_photos' ] ) ) {
    221221                        return $caps;
    222222                }
Note: See TracChangeset for help on using the changeset viewer.