Changeset 47550 for trunk/src/wp-includes/class-wp-query.php
- Timestamp:
- 04/05/2020 03:00:44 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-query.php
r47509 r47550 2157 2157 2158 2158 $post_status_join = true; 2159 } elseif ( in_array( 'attachment', (array) $post_type ) ) {2159 } elseif ( in_array( 'attachment', (array) $post_type, true ) ) { 2160 2160 $post_status_join = true; 2161 2161 } … … 2178 2178 } 2179 2179 2180 if ( ! in_array( $queried_taxonomy, array( 'category', 'post_tag' ) ) ) {2180 if ( ! in_array( $queried_taxonomy, array( 'category', 'post_tag' ), true ) ) { 2181 2181 $q['taxonomy'] = $queried_taxonomy; 2182 2182 … … 2464 2464 $p_status = array(); 2465 2465 $e_status = array(); 2466 if ( in_array( 'any', $q_status ) ) {2466 if ( in_array( 'any', $q_status, true ) ) { 2467 2467 foreach ( get_post_stati( array( 'exclude_from_search' => true ) ) as $status ) { 2468 if ( ! in_array( $status, $q_status ) ) {2468 if ( ! in_array( $status, $q_status, true ) ) { 2469 2469 $e_status[] = "{$wpdb->posts}.post_status <> '$status'"; 2470 2470 } … … 2472 2472 } else { 2473 2473 foreach ( get_post_stati() as $status ) { 2474 if ( in_array( $status, $q_status ) ) {2474 if ( in_array( $status, $q_status, true ) ) { 2475 2475 if ( 'private' == $status ) { 2476 2476 $p_status[] = "{$wpdb->posts}.post_status = '$status'"; … … 3084 3084 3085 3085 // If the post_status was specifically requested, let it pass through. 3086 if ( ! in_array( $status, $q_status ) ) {3086 if ( ! in_array( $status, $q_status, true ) ) { 3087 3087 $post_status_obj = get_post_status_object( $status ); 3088 3088 … … 3565 3565 */ 3566 3566 public function __get( $name ) { 3567 if ( in_array( $name, $this->compat_fields ) ) {3567 if ( in_array( $name, $this->compat_fields, true ) ) { 3568 3568 return $this->$name; 3569 3569 } … … 3579 3579 */ 3580 3580 public function __isset( $name ) { 3581 if ( in_array( $name, $this->compat_fields ) ) {3581 if ( in_array( $name, $this->compat_fields, true ) ) { 3582 3582 return isset( $this->$name ); 3583 3583 } … … 3594 3594 */ 3595 3595 public function __call( $name, $arguments ) { 3596 if ( in_array( $name, $this->compat_methods ) ) {3596 if ( in_array( $name, $this->compat_methods, true ) ) { 3597 3597 return $this->$name( ...$arguments ); 3598 3598 } … … 3633 3633 $post_type_object = get_post_type_object( $post_type ); 3634 3634 3635 return in_array( $post_type_object->name, (array) $post_types );3635 return in_array( $post_type_object->name, (array) $post_types, true ); 3636 3636 } 3637 3637 … … 3658 3658 $post_obj = $this->get_queried_object(); 3659 3659 3660 if ( in_array( (string) $post_obj->ID, $attachment ) ) {3660 if ( in_array( (string) $post_obj->ID, $attachment, true ) ) { 3661 3661 return true; 3662 } elseif ( in_array( $post_obj->post_title, $attachment ) ) {3662 } elseif ( in_array( $post_obj->post_title, $attachment, true ) ) { 3663 3663 return true; 3664 } elseif ( in_array( $post_obj->post_name, $attachment ) ) {3664 } elseif ( in_array( $post_obj->post_name, $attachment, true ) ) { 3665 3665 return true; 3666 3666 } … … 3693 3693 $author = array_map( 'strval', (array) $author ); 3694 3694 3695 if ( in_array( (string) $author_obj->ID, $author ) ) {3695 if ( in_array( (string) $author_obj->ID, $author, true ) ) { 3696 3696 return true; 3697 } elseif ( in_array( $author_obj->nickname, $author ) ) {3697 } elseif ( in_array( $author_obj->nickname, $author, true ) ) { 3698 3698 return true; 3699 } elseif ( in_array( $author_obj->user_nicename, $author ) ) {3699 } elseif ( in_array( $author_obj->user_nicename, $author, true ) ) { 3700 3700 return true; 3701 3701 } … … 3729 3729 $category = array_map( 'strval', (array) $category ); 3730 3730 3731 if ( in_array( (string) $cat_obj->term_id, $category ) ) {3731 if ( in_array( (string) $cat_obj->term_id, $category, true ) ) { 3732 3732 return true; 3733 } elseif ( in_array( $cat_obj->name, $category ) ) {3733 } elseif ( in_array( $cat_obj->name, $category, true ) ) { 3734 3734 return true; 3735 } elseif ( in_array( $cat_obj->slug, $category ) ) {3735 } elseif ( in_array( $cat_obj->slug, $category, true ) ) { 3736 3736 return true; 3737 3737 } … … 3765 3765 $tag = array_map( 'strval', (array) $tag ); 3766 3766 3767 if ( in_array( (string) $tag_obj->term_id, $tag ) ) {3767 if ( in_array( (string) $tag_obj->term_id, $tag, true ) ) { 3768 3768 return true; 3769 } elseif ( in_array( $tag_obj->name, $tag ) ) {3769 } elseif ( in_array( $tag_obj->name, $tag, true ) ) { 3770 3770 return true; 3771 } elseif ( in_array( $tag_obj->slug, $tag ) ) {3771 } elseif ( in_array( $tag_obj->slug, $tag, true ) ) { 3772 3772 return true; 3773 3773 } … … 3813 3813 3814 3814 // Check that the taxonomy matches. 3815 if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array ) ) ) {3815 if ( ! ( isset( $queried_object->taxonomy ) && count( $tax_array ) && in_array( $queried_object->taxonomy, $tax_array, true ) ) ) { 3816 3816 return false; 3817 3817 } … … 3884 3884 $qv = get_default_feed(); 3885 3885 } 3886 return in_array( $qv, (array) $feeds );3886 return in_array( $qv, (array) $feeds, true ); 3887 3887 } 3888 3888 … … 4005 4005 $page = array_map( 'strval', (array) $page ); 4006 4006 4007 if ( in_array( (string) $page_obj->ID, $page ) ) {4007 if ( in_array( (string) $page_obj->ID, $page, true ) ) { 4008 4008 return true; 4009 } elseif ( in_array( $page_obj->post_title, $page ) ) {4009 } elseif ( in_array( $page_obj->post_title, $page, true ) ) { 4010 4010 return true; 4011 } elseif ( in_array( $page_obj->post_name, $page ) ) {4011 } elseif ( in_array( $page_obj->post_name, $page, true ) ) { 4012 4012 return true; 4013 4013 } else { … … 4112 4112 $post = array_map( 'strval', (array) $post ); 4113 4113 4114 if ( in_array( (string) $post_obj->ID, $post ) ) {4114 if ( in_array( (string) $post_obj->ID, $post, true ) ) { 4115 4115 return true; 4116 } elseif ( in_array( $post_obj->post_title, $post ) ) {4116 } elseif ( in_array( $post_obj->post_title, $post, true ) ) { 4117 4117 return true; 4118 } elseif ( in_array( $post_obj->post_name, $post ) ) {4118 } elseif ( in_array( $post_obj->post_name, $post, true ) ) { 4119 4119 return true; 4120 4120 } else { … … 4157 4157 $post_obj = $this->get_queried_object(); 4158 4158 4159 return in_array( $post_obj->post_type, (array) $post_types );4159 return in_array( $post_obj->post_type, (array) $post_types, true ); 4160 4160 } 4161 4161
Note: See TracChangeset
for help on using the changeset viewer.