Changeset 58998
- Timestamp:
- 09/08/2024 07:16:07 PM (5 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/capabilities.php
r58099 r58998 48 48 case 'remove_user': 49 49 // In multisite the user must be a super admin to remove themselves. 50 if ( isset( $args[0] ) && $user_id == $args[0] && ! is_super_admin( $user_id ) ) {50 if ( isset( $args[0] ) && $user_id === (int) $args[0] && ! is_super_admin( $user_id ) ) { 51 51 $caps[] = 'do_not_allow'; 52 52 } else { … … 61 61 case 'edit_users': 62 62 // Allow user to edit themselves. 63 if ( 'edit_user' === $cap && isset( $args[0] ) && $user_id == $args[0] ) {63 if ( 'edit_user' === $cap && isset( $args[0] ) && $user_id === (int) $args[0] ) { 64 64 break; 65 65 } … … 104 104 } 105 105 106 if ( ( get_option( 'page_for_posts' ) == $post->ID ) || ( get_option( 'page_on_front' ) == $post->ID ) ) { 106 if ( (int) get_option( 'page_for_posts' ) === $post->ID 107 || (int) get_option( 'page_on_front' ) === $post->ID 108 ) { 107 109 $caps[] = 'manage_options'; 108 110 break; … … 138 140 139 141 // If the post author is set and the user is the author... 140 if ( $post->post_author && $user_id == $post->post_author ) {142 if ( $post->post_author && $user_id === (int) $post->post_author ) { 141 143 // If the post is published or scheduled... 142 144 if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { … … 241 243 242 244 // If the post author is set and the user is the author... 243 if ( $post->post_author && $user_id == $post->post_author ) {245 if ( $post->post_author && $user_id === (int) $post->post_author ) { 244 246 // If the post is published or scheduled... 245 247 if ( in_array( $post->post_status, array( 'publish', 'future' ), true ) ) { … … 363 365 } 364 366 365 if ( $post->post_author && $user_id == $post->post_author ) {367 if ( $post->post_author && $user_id === (int) $post->post_author ) { 366 368 $caps[] = $post_type->cap->read; 367 369 } elseif ( $status_obj->private ) { … … 731 733 732 734 if ( 'delete_term' === $cap 733 && ( get_option( 'default_' . $term->taxonomy )== $term->term_id734 || get_option( 'default_term_' . $term->taxonomy )== $term->term_id )735 && ( (int) get_option( 'default_' . $term->taxonomy ) === $term->term_id 736 || (int) get_option( 'default_term_' . $term->taxonomy ) === $term->term_id ) 735 737 ) { 736 738 $caps[] = 'do_not_allow';
Note: See TracChangeset
for help on using the changeset viewer.