Changeset 47550 for trunk/src/wp-includes/class-wp-xmlrpc-server.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-xmlrpc-server.php
r47233 r47550 758 758 ); 759 759 760 if ( in_array( 'labels', $fields ) ) {760 if ( in_array( 'labels', $fields, true ) ) { 761 761 $_taxonomy['labels'] = (array) $taxonomy->labels; 762 762 } 763 763 764 if ( in_array( 'cap', $fields ) ) {764 if ( in_array( 'cap', $fields, true ) ) { 765 765 $_taxonomy['cap'] = (array) $taxonomy->cap; 766 766 } 767 767 768 if ( in_array( 'menu', $fields ) ) {768 if ( in_array( 'menu', $fields, true ) ) { 769 769 $_taxonomy['show_in_menu'] = (bool) $_taxonomy->show_in_menu; 770 770 } 771 771 772 if ( in_array( 'object_type', $fields ) ) {772 if ( in_array( 'object_type', $fields, true ) ) { 773 773 $_taxonomy['object_type'] = array_unique( (array) $taxonomy->object_type ); 774 774 } … … 903 903 904 904 // Merge requested $post_fields fields into $_post. 905 if ( in_array( 'post', $fields ) ) {905 if ( in_array( 'post', $fields, true ) ) { 906 906 $_post = array_merge( $_post, $post_fields ); 907 907 } else { … … 910 910 } 911 911 912 $all_taxonomy_fields = in_array( 'taxonomies', $fields );913 914 if ( $all_taxonomy_fields || in_array( 'terms', $fields ) ) {912 $all_taxonomy_fields = in_array( 'taxonomies', $fields, true ); 913 914 if ( $all_taxonomy_fields || in_array( 'terms', $fields, true ) ) { 915 915 $post_type_taxonomies = get_object_taxonomies( $post['post_type'], 'names' ); 916 916 $terms = wp_get_object_terms( $post['ID'], $post_type_taxonomies ); … … 921 921 } 922 922 923 if ( in_array( 'custom_fields', $fields ) ) {923 if ( in_array( 'custom_fields', $fields, true ) ) { 924 924 $_post['custom_fields'] = $this->get_custom_fields( $post['ID'] ); 925 925 } 926 926 927 if ( in_array( 'enclosure', $fields ) ) {927 if ( in_array( 'enclosure', $fields, true ) ) { 928 928 $_post['enclosure'] = array(); 929 929 $enclosures = (array) get_post_meta( $post['ID'], 'enclosure' ); … … 970 970 ); 971 971 972 if ( in_array( 'labels', $fields ) ) {972 if ( in_array( 'labels', $fields, true ) ) { 973 973 $_post_type['labels'] = (array) $post_type->labels; 974 974 } 975 975 976 if ( in_array( 'cap', $fields ) ) {976 if ( in_array( 'cap', $fields, true ) ) { 977 977 $_post_type['cap'] = (array) $post_type->cap; 978 978 $_post_type['map_meta_cap'] = (bool) $post_type->map_meta_cap; 979 979 } 980 980 981 if ( in_array( 'menu', $fields ) ) {981 if ( in_array( 'menu', $fields, true ) ) { 982 982 $_post_type['menu_position'] = (int) $post_type->menu_position; 983 983 $_post_type['menu_icon'] = $post_type->menu_icon; … … 985 985 } 986 986 987 if ( in_array( 'taxonomies', $fields ) ) {987 if ( in_array( 'taxonomies', $fields, true ) ) { 988 988 $_post_type['taxonomies'] = get_object_taxonomies( $post_type->name, 'names' ); 989 989 } … … 1191 1191 ); 1192 1192 1193 if ( in_array( 'all', $fields ) ) {1193 if ( in_array( 'all', $fields, true ) ) { 1194 1194 $_user = array_merge( $_user, $user_fields ); 1195 1195 } else { 1196 if ( in_array( 'basic', $fields ) ) {1196 if ( in_array( 'basic', $fields, true ) ) { 1197 1197 $basic_fields = array( 'username', 'email', 'registered', 'display_name', 'nicename' ); 1198 1198 $fields = array_merge( $fields, $basic_fields ); … … 1578 1578 $term_names = $post_data['terms_names'][ $taxonomy ]; 1579 1579 foreach ( $term_names as $term_name ) { 1580 if ( in_array( $term_name, $ambiguous_terms ) ) {1580 if ( in_array( $term_name, $ambiguous_terms, true ) ) { 1581 1581 return new IXR_Error( 401, __( 'Ambiguous term name used in a hierarchical taxonomy. Please use term ID instead.' ) ); 1582 1582 } … … 3758 3758 $statuses = array_keys( $statuses ); 3759 3759 3760 if ( ! in_array( $content_struct['status'], $statuses ) ) {3760 if ( ! in_array( $content_struct['status'], $statuses, true ) ) { 3761 3761 return new IXR_Error( 401, __( 'Invalid comment status.' ) ); 3762 3762 } … … 5669 5669 5670 5670 // Use wp.editPost to edit post types other than post and page. 5671 if ( ! in_array( $postdata['post_type'], array( 'post', 'page' ) ) ) {5671 if ( ! in_array( $postdata['post_type'], array( 'post', 'page' ), true ) ) { 5672 5672 return new IXR_Error( 401, __( 'Invalid post type.' ) ); 5673 5673 }
Note: See TracChangeset
for help on using the changeset viewer.