Bump WordPress to latest trunk.

parent aafda046
......@@ -57,7 +57,7 @@ if ( null === $result || ( is_wp_error( $result ) && 'invalid_key' === $result->
} elseif ( is_wp_error( $result ) ) {
$error_code = $result->get_error_code();
if ( ! in_array( $error_code, $valid_error_codes ) ) {
if ( ! in_array( $error_code, $valid_error_codes, true ) ) {
status_header( 400 );
}
}
......@@ -136,7 +136,7 @@ get_header( 'wp-activate' );
<?php
} else {
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes ) ) {
if ( is_wp_error( $result ) && in_array( $result->get_error_code(), $valid_error_codes, true ) ) {
$signup = $result->get_error_data();
?>
<h2><?php _e( 'Your account is now active!' ); ?></h2>
......
......@@ -146,11 +146,11 @@ $core_actions_post_deprecated = array( 'wp-fullscreen-save-post', 'press-this-sa
$core_actions_post = array_merge( $core_actions_post, $core_actions_post_deprecated );
// Register core Ajax calls.
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get ) ) {
if ( ! empty( $_GET['action'] ) && in_array( $_GET['action'], $core_actions_get, true ) ) {
add_action( 'wp_ajax_' . $_GET['action'], 'wp_ajax_' . str_replace( '-', '_', $_GET['action'] ), 1 );
}
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post ) ) {
if ( ! empty( $_POST['action'] ) && in_array( $_POST['action'], $core_actions_post, true ) ) {
add_action( 'wp_ajax_' . $_POST['action'], 'wp_ajax_' . str_replace( '-', '_', $_POST['action'] ), 1 );
}
......
......@@ -255,7 +255,7 @@ switch ( $action ) {
case 'unapprovecomment':
$comment_id = absint( $_REQUEST['c'] );
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
if ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
check_admin_referer( 'approve-comment_' . $comment_id );
} else {
check_admin_referer( 'delete-comment_' . $comment_id );
......@@ -275,7 +275,7 @@ switch ( $action ) {
$redir = wp_get_referer();
} elseif ( '' != wp_get_original_referer() && ! $noredir ) {
$redir = wp_get_original_referer();
} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ) ) ) {
} elseif ( in_array( $action, array( 'approvecomment', 'unapprovecomment' ), true ) ) {
$redir = admin_url( 'edit-comments.php?p=' . absint( $comment->comment_post_ID ) );
} else {
$redir = admin_url( 'edit-comments.php' );
......
......@@ -19,7 +19,7 @@ if ( ! $tax ) {
wp_die( __( 'Invalid taxonomy.' ) );
}
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ) ) ) {
if ( ! in_array( $tax->name, get_taxonomies( array( 'show_ui' => true ) ), true ) ) {
wp_die( __( 'Sorry, you are not allowed to edit terms in this taxonomy.' ) );
}
......
......@@ -13,7 +13,7 @@ if ( ! $typenow ) {
wp_die( __( 'Invalid post type.' ) );
}
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ), true ) ) {
wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
}
......
......@@ -976,7 +976,7 @@ function wp_ajax_dim_comment() {
check_ajax_referer( "approve-comment_$id" );
if ( in_array( $current, array( 'unapproved', 'spam' ) ) ) {
if ( in_array( $current, array( 'unapproved', 'spam' ), true ) ) {
$result = wp_set_comment_status( $comment, 'approve', true );
} else {
$result = wp_set_comment_status( $comment, 'hold', true );
......@@ -1271,7 +1271,7 @@ function wp_ajax_replyto_comment( $action ) {
if ( empty( $post->post_status ) ) {
wp_die( 1 );
} elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ) ) ) {
} elseif ( in_array( $post->post_status, array( 'draft', 'pending', 'trash' ), true ) ) {
wp_die( __( 'Error: You are replying to a comment on a draft post.' ) );
}
......@@ -2057,7 +2057,7 @@ function wp_ajax_inline_save() {
}
// Hack: wp_unique_post_slug() doesn't work for drafts, so we will fake that our post is published.
if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ) ) ) {
if ( ! empty( $data['post_name'] ) && in_array( $post['post_status'], array( 'draft', 'pending' ), true ) ) {
$post['post_status'] = 'publish';
$data['post_name'] = wp_unique_post_slug( $data['post_name'], $post['ID'], $post['post_status'], $post['post_type'], $post['post_parent'] );
}
......@@ -2525,7 +2525,7 @@ function wp_ajax_upload_attachment() {
}
// If the context is custom header or background, make sure the uploaded file is an image.
if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ) ) ) {
if ( isset( $post_data['context'] ) && in_array( $post_data['context'], array( 'custom-header', 'custom-background' ), true ) ) {
$wp_filetype = wp_check_filetype_and_ext( $_FILES['async-upload']['tmp_name'], $_FILES['async-upload']['name'] );
if ( ! wp_match_mime_types( 'image', $wp_filetype['type'] ) ) {
......@@ -2852,7 +2852,7 @@ function wp_ajax_dismiss_wp_pointer() {
$dismissed = array_filter( explode( ',', (string) get_user_meta( get_current_user_id(), 'dismissed_wp_pointers', true ) ) );
if ( in_array( $pointer, $dismissed ) ) {
if ( in_array( $pointer, $dismissed, true ) ) {
wp_die( 0 );
}
......
......@@ -601,7 +601,7 @@ class Custom_Background {
);
$size = 'thumbnail';
if ( in_array( $_POST['size'], $sizes ) ) {
if ( in_array( $_POST['size'], $sizes, true ) ) {
$size = esc_attr( $_POST['size'] );
}
......
......@@ -1097,7 +1097,7 @@ endif;
return;
}
if ( in_array( $choice, array( 'remove-header', 'random-default-image', 'random-uploaded-image' ) ) ) {
if ( in_array( $choice, array( 'remove-header', 'random-default-image', 'random-uploaded-image' ), true ) ) {
set_theme_mod( 'header_image', $choice );
remove_theme_mod( 'header_image_data' );
return;
......
......@@ -82,7 +82,8 @@ class Walker_Category_Checklist extends Walker {
}
$args['popular_cats'] = empty( $args['popular_cats'] ) ? array() : $args['popular_cats'];
$class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
$class = in_array( $category->term_id, $args['popular_cats'] ) ? ' class="popular-category"' : '';
$args['selected_cats'] = empty( $args['selected_cats'] ) ? array() : $args['selected_cats'];
......
......@@ -577,7 +577,7 @@ class WP_Automatic_Updater {
*/
$send = true;
$transient_failures = array( 'incompatible_archive', 'download_failed', 'insane_distro', 'locked' );
if ( in_array( $error_code, $transient_failures ) && ! get_site_option( 'auto_core_update_failed' ) ) {
if ( in_array( $error_code, $transient_failures, true ) && ! get_site_option( 'auto_core_update_failed' ) ) {
wp_schedule_single_event( time() + HOUR_IN_SECONDS, 'wp_maybe_auto_update' );
$send = false;
}
......@@ -596,7 +596,7 @@ class WP_Automatic_Updater {
'error_code' => $error_code,
'error_data' => $result->get_error_data(),
'timestamp' => time(),
'retry' => in_array( $error_code, $transient_failures ),
'retry' => in_array( $error_code, $transient_failures, true ),
)
);
......
......@@ -87,7 +87,7 @@ class WP_Comments_List_Table extends WP_List_Table {
global $post_id, $comment_status, $search, $comment_type;
$comment_status = isset( $_REQUEST['comment_status'] ) ? $_REQUEST['comment_status'] : 'all';
if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ) ) ) {
if ( ! in_array( $comment_status, array( 'all', 'mine', 'moderated', 'approved', 'spam', 'trash' ), true ) ) {
$comment_status = 'all';
}
......@@ -344,13 +344,13 @@ class WP_Comments_List_Table extends WP_List_Table {
global $comment_status;
$actions = array();
if ( in_array( $comment_status, array( 'all', 'approved' ) ) ) {
if ( in_array( $comment_status, array( 'all', 'approved' ), true ) ) {
$actions['unapprove'] = __( 'Unapprove' );
}
if ( in_array( $comment_status, array( 'all', 'moderated' ) ) ) {
if ( in_array( $comment_status, array( 'all', 'moderated' ), true ) ) {
$actions['approve'] = __( 'Approve' );
}
if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ) ) ) {
if ( in_array( $comment_status, array( 'all', 'moderated', 'approved', 'trash' ), true ) ) {
$actions['spam'] = _x( 'Mark as Spam', 'comment' );
}
......@@ -360,7 +360,7 @@ class WP_Comments_List_Table extends WP_List_Table {
$actions['unspam'] = _x( 'Not Spam', 'comment' );
}
if ( in_array( $comment_status, array( 'trash', 'spam' ) ) || ! EMPTY_TRASH_DAYS ) {
if ( in_array( $comment_status, array( 'trash', 'spam' ), true ) || ! EMPTY_TRASH_DAYS ) {
$actions['delete'] = __( 'Delete Permanently' );
} else {
$actions['trash'] = __( 'Move to Trash' );
......
......@@ -466,7 +466,7 @@ class WP_Community_Events {
$trimmed_event_types = wp_list_pluck( $response_body['events'], 'type' );
// Make sure the soonest upcoming WordCamp is pinned in the list.
if ( ! in_array( 'wordcamp', $trimmed_event_types ) && $wordcamps ) {
if ( ! in_array( 'wordcamp', $trimmed_event_types, true ) && $wordcamps ) {
array_pop( $response_body['events'] );
array_push( $response_body['events'], $wordcamps[0] );
}
......
......@@ -181,7 +181,7 @@ class WP_List_Table {
* @return mixed Property.
*/
public function __get( $name ) {
if ( in_array( $name, $this->compat_fields ) ) {
if ( in_array( $name, $this->compat_fields, true ) ) {
return $this->$name;
}
}
......@@ -196,7 +196,7 @@ class WP_List_Table {
* @return mixed Newly-set property.
*/
public function __set( $name, $value ) {
if ( in_array( $name, $this->compat_fields ) ) {
if ( in_array( $name, $this->compat_fields, true ) ) {
return $this->$name = $value;
}
}
......@@ -210,7 +210,7 @@ class WP_List_Table {
* @return bool Whether the property is set.
*/
public function __isset( $name ) {
if ( in_array( $name, $this->compat_fields ) ) {
if ( in_array( $name, $this->compat_fields, true ) ) {
return isset( $this->$name );
}
}
......@@ -223,7 +223,7 @@ class WP_List_Table {
* @param string $name Property to unset.
*/
public function __unset( $name ) {
if ( in_array( $name, $this->compat_fields ) ) {
if ( in_array( $name, $this->compat_fields, true ) ) {
unset( $this->$name );
}
}
......@@ -238,7 +238,7 @@ class WP_List_Table {
* @return mixed|bool Return value of the callback, false otherwise.
*/
public function __call( $name, $arguments ) {
if ( in_array( $name, $this->compat_methods ) ) {
if ( in_array( $name, $this->compat_methods, true ) ) {
return $this->$name( ...$arguments );
}
return false;
......@@ -1133,13 +1133,13 @@ class WP_List_Table {
foreach ( $columns as $column_key => $column_display_name ) {
$class = array( 'manage-column', "column-$column_key" );
if ( in_array( $column_key, $hidden ) ) {
if ( in_array( $column_key, $hidden, true ) ) {
$class[] = 'hidden';
}
if ( 'cb' === $column_key ) {
$class[] = 'check-column';
} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) ) {
} elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ), true ) ) {
$class[] = 'num';
}
......@@ -1329,7 +1329,7 @@ class WP_List_Table {
$classes .= ' has-row-actions column-primary';
}
if ( in_array( $column_name, $hidden ) ) {
if ( in_array( $column_name, $hidden, true ) ) {
$classes .= ' hidden';
}
......
......@@ -45,7 +45,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
);
$status = isset( $_REQUEST['theme_status'] ) ? $_REQUEST['theme_status'] : 'all';
if ( ! in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ) ) ) {
if ( ! in_array( $status, array( 'all', 'enabled', 'disabled', 'upgrade', 'search', 'broken' ), true ) ) {
$status = 'all';
}
......@@ -143,7 +143,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
$totals[ $type ] = count( $list );
}
if ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ) ) ) {
if ( empty( $themes[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {
$status = 'all';
}
......@@ -674,7 +674,7 @@ class WP_MS_Themes_List_Table extends WP_List_Table {
foreach ( $columns as $column_name => $column_display_name ) {
$extra_classes = '';
if ( in_array( $column_name, $hidden ) ) {
if ( in_array( $column_name, $hidden, true ) ) {
$extra_classes .= ' hidden';
}
......
......@@ -281,7 +281,7 @@ class WP_MS_Users_List_Table extends WP_List_Table {
<?php
echo $edit;
if ( in_array( $user->user_login, $super_admins ) ) {
if ( in_array( $user->user_login, $super_admins, true ) ) {
echo ' &mdash; ' . __( 'Super Admin' );
}
?>
......
......@@ -136,7 +136,7 @@ class WP_Plugin_Install_List_Table extends WP_List_Table {
$nonmenu_tabs = apply_filters( 'install_plugins_nonmenu_tabs', $nonmenu_tabs );
// If a non-valid menu tab has been selected, And it's not a non-menu action.
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) ) {
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {
$tab = key( $tabs );
}
......
......@@ -39,8 +39,10 @@ class WP_Plugins_List_Table extends WP_List_Table {
)
);
$status_whitelist = array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused' );
$status = 'all';
if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], array( 'active', 'inactive', 'recently_activated', 'upgrade', 'mustuse', 'dropins', 'search', 'paused' ) ) ) {
if ( isset( $_REQUEST['plugin_status'] ) && in_array( $_REQUEST['plugin_status'], $status_whitelist, true ) ) {
$status = $_REQUEST['plugin_status'];
}
......@@ -243,7 +245,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
$totals[ $type ] = count( $list );
}
if ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ) ) ) {
if ( empty( $plugins[ $status ] ) && ! in_array( $status, array( 'all', 'search' ), true ) ) {
$status = 'all';
}
......@@ -398,7 +400,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
global $status;
return array(
'cb' => ! in_array( $status, array( 'mustuse', 'dropins' ) ) ? '<input type="checkbox" />' : '',
'cb' => ! in_array( $status, array( 'mustuse', 'dropins' ), true ) ? '<input type="checkbox" />' : '',
'name' => __( 'Plugin' ),
'description' => __( 'Description' ),
);
......@@ -542,7 +544,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
public function bulk_actions( $which = '' ) {
global $status;
if ( in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
if ( in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {
return;
}
......@@ -556,7 +558,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
protected function extra_tablenav( $which ) {
global $status;
if ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ) ) ) {
if ( ! in_array( $status, array( 'recently_activated', 'mustuse', 'dropins' ), true ) ) {
return;
}
......@@ -597,7 +599,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
public function display_rows() {
global $status;
if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ) ) ) {
if ( is_multisite() && ! $this->screen->in_admin( 'network' ) && in_array( $status, array( 'mustuse', 'dropins' ), true ) ) {
return;
}
......@@ -831,7 +833,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
$compatible_php = is_php_version_compatible( $requires_php );
$class = $is_active ? 'active' : 'inactive';
$checkbox_id = 'checkbox_' . md5( $plugin_data['Name'] );
if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ) ) || ! $compatible_php ) {
if ( $restrict_network_active || $restrict_network_only || in_array( $status, array( 'mustuse', 'dropins' ), true ) || ! $compatible_php ) {
$checkbox = '';
} else {
$checkbox = sprintf(
......@@ -870,7 +872,7 @@ class WP_Plugins_List_Table extends WP_List_Table {
foreach ( $columns as $column_name => $column_display_name ) {
$extra_classes = '';
if ( in_array( $column_name, $hidden ) ) {
if ( in_array( $column_name, $hidden, true ) ) {
$extra_classes = ' hidden';
}
......
......@@ -161,7 +161,7 @@ class WP_Posts_List_Table extends WP_List_Table {
} else {
$post_counts = (array) wp_count_posts( $post_type, 'readable' );
if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati ) ) {
if ( isset( $_REQUEST['post_status'] ) && in_array( $_REQUEST['post_status'], $avail_post_stati, true ) ) {
$total_items = $post_counts[ $_REQUEST['post_status'] ];
} elseif ( isset( $_REQUEST['show_sticky'] ) && $_REQUEST['show_sticky'] ) {
$total_items = $this->sticky_posts_count;
......@@ -346,7 +346,7 @@ class WP_Posts_List_Table extends WP_List_Table {
$status_name = $status->name;
if ( ! in_array( $status_name, $avail_post_stati ) || empty( $num_posts->$status_name ) ) {
if ( ! in_array( $status_name, $avail_post_stati, true ) || empty( $num_posts->$status_name ) ) {
continue;
}
......@@ -391,7 +391,7 @@ class WP_Posts_List_Table extends WP_List_Table {
);
// Sticky comes after Publish, or if not listed, after All.
$split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ) );
$split = 1 + array_search( ( isset( $status_links['publish'] ) ? 'publish' : 'all' ), array_keys( $status_links ), true );
$status_links = array_merge( array_slice( $status_links, 0, $split ), $sticky_link, array_slice( $status_links, $split ) );
}
......@@ -646,7 +646,7 @@ class WP_Posts_List_Table extends WP_List_Table {
}
$post_status = ! empty( $_REQUEST['post_status'] ) ? $_REQUEST['post_status'] : 'all';
if ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ) ) ) {
if ( post_type_supports( $post_type, 'comments' ) && ! in_array( $post_status, array( 'pending', 'draft', 'future' ), true ) ) {
$posts_columns['comments'] = '<span class="vers comment-grey-bubble" title="' . esc_attr__( 'Comments' ) . '"><span class="screen-reader-text">' . __( 'Comments' ) . '</span></span>';
}
......@@ -1384,7 +1384,7 @@ class WP_Posts_List_Table extends WP_List_Table {
}
if ( is_post_type_viewable( $post_type_object ) ) {
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ) ) ) {
if ( in_array( $post->post_status, array( 'pending', 'draft', 'future' ), true ) ) {
if ( $can_edit_post ) {
$preview_link = get_preview_post_link( $post );
$actions['view'] = sprintf(
......
......@@ -1157,7 +1157,7 @@ final class WP_Screen {
foreach ( $columns as $column => $title ) {
// Can't hide these for they are special.
if ( in_array( $column, $special ) ) {
if ( in_array( $column, $special, true ) ) {
continue;
}
......@@ -1174,7 +1174,7 @@ final class WP_Screen {
$id = "$column-hide";
echo '<label>';
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden ), true, false ) . ' />';
echo '<input class="hide-column-tog" name="' . $id . '" type="checkbox" id="' . $id . '" value="' . $column . '"' . checked( ! in_array( $column, $hidden, true ), true, false ) . ' />';
echo "$title</label>\n";
}
?>
......@@ -1310,7 +1310,7 @@ final class WP_Screen {
*/
$view_mode_post_types = apply_filters( 'view_mode_post_types', $view_mode_post_types );
if ( ! in_array( $this->post_type, $view_mode_post_types ) ) {
if ( ! in_array( $this->post_type, $view_mode_post_types, true ) ) {
return;
}
......
......@@ -61,7 +61,7 @@ class WP_Terms_List_Table extends WP_List_Table {
$tax = get_taxonomy( $taxonomy );
// @todo Still needed? Maybe just the show_ui part.
if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ) ) ) {
if ( empty( $post_type ) || ! in_array( $post_type, get_post_types( array( 'show_ui' => true ) ), true ) ) {
$post_type = 'post';
}
......
......@@ -82,7 +82,7 @@ class WP_Theme_Install_List_Table extends WP_Themes_List_Table {
$nonmenu_tabs = apply_filters( 'install_themes_nonmenu_tabs', $nonmenu_tabs );
// If a non-valid menu tab has been selected, And it's not a non-menu action.
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs ) ) ) {
if ( empty( $tab ) || ( ! isset( $tabs[ $tab ] ) && ! in_array( $tab, (array) $nonmenu_tabs, true ) ) ) {
$tab = key( $tabs );
}
......
......@@ -302,14 +302,14 @@ class WP_Themes_List_Table extends WP_List_Table {
public function search_theme( $theme ) {
// Search the features.
foreach ( $this->features as $word ) {
if ( ! in_array( $word, $theme->get( 'Tags' ) ) ) {
if ( ! in_array( $word, $theme->get( 'Tags' ), true ) ) {
return false;
}
}
// Match all phrases.
foreach ( $this->search_terms as $word ) {
if ( in_array( $word, $theme->get( 'Tags' ) ) ) {
if ( in_array( $word, $theme->get( 'Tags' ), true ) ) {
continue;
}
......
......@@ -545,7 +545,7 @@ class WP_Upgrader {
$protected_directories = array_merge( $protected_directories, $wp_theme_directories );
}
if ( in_array( $destination, $protected_directories ) ) {
if ( in_array( $destination, $protected_directories, true ) ) {
$remote_destination = trailingslashit( $remote_destination ) . trailingslashit( basename( $source ) );
$destination = trailingslashit( $destination ) . trailingslashit( basename( $source ) );
}
......
......@@ -517,7 +517,7 @@ class WP_Users_List_Table extends WP_List_Table {
$classes .= ' num'; // Special case for that column.
}
if ( in_array( $column_name, $hidden ) ) {
if ( in_array( $column_name, $hidden, true ) ) {
$classes .= ' hidden';
}
......
......@@ -195,7 +195,7 @@ function wp_add_dashboard_widget( $widget_id, $widget_name, $callback, $control_
$side_widgets = array( 'dashboard_quick_press', 'dashboard_primary' );
$location = 'normal';
if ( in_array( $widget_id, $side_widgets ) ) {
if ( in_array( $widget_id, $side_widgets, true ) ) {
$location = 'side';
}
......
......@@ -1215,7 +1215,7 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f
}
// Check we can process signatures.
if ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) || ! in_array( 'sha384', array_map( 'strtolower', hash_algos() ) ) ) {
if ( ! function_exists( 'sodium_crypto_sign_verify_detached' ) || ! in_array( 'sha384', array_map( 'strtolower', hash_algos() ), true ) ) {
return new WP_Error(
'signature_verification_unsupported',
sprintf(
......@@ -1540,7 +1540,7 @@ function _unzip_file_ziparchive( $file, $to, $needed_dirs = array() ) {
}
$parent_folder = dirname( $dir );
while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs ) ) {
while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {
$needed_dirs[] = $parent_folder;
$parent_folder = dirname( $parent_folder );
}
......@@ -1666,7 +1666,7 @@ function _unzip_file_pclzip( $file, $to, $needed_dirs = array() ) {
}
$parent_folder = dirname( $dir );
while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs ) ) {
while ( ! empty( $parent_folder ) && untrailingslashit( $to ) != $parent_folder && ! in_array( $parent_folder, $needed_dirs, true ) ) {
$needed_dirs[] = $parent_folder;
$parent_folder = dirname( $parent_folder );
}
......
......@@ -950,7 +950,7 @@ function wp_media_upload_handler() {
if ( isset( $_GET['tab'] ) && 'type_url' === $_GET['tab'] ) {
$type = 'image';
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ) ) ) {
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ), true ) ) {
$type = $_GET['type'];
}
......
......@@ -334,7 +334,7 @@ endif;
<div id="publishing-action">
<span class="spinner"></span>
<?php
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ) ) || 0 == $post->ID ) {
if ( ! in_array( $post->post_status, array( 'publish', 'future', 'private' ), true ) || 0 == $post->ID ) {
if ( $can_publish ) :
if ( ! empty( $post->post_date_gmt ) && time() < strtotime( $post->post_date_gmt . ' +0000' ) ) :
?>
......@@ -471,7 +471,7 @@ function post_format_meta_box( $post, $box ) {
$post_format = '0';
}
// Add in the current one if it isn't there yet, in case the current theme doesn't support it.
if ( $post_format && ! in_array( $post_format, $post_formats[0] ) ) {
if ( $post_format && ! in_array( $post_format, $post_formats[0], true ) ) {
$post_formats[0][] = $post_format;
}
?>
......@@ -847,7 +847,7 @@ function post_comment_meta_box( $post ) {
echo '<p id="no-comments">' . __( 'No comments yet.' ) . '</p>';
} else {
$hidden = get_hidden_meta_boxes( get_current_screen() );
if ( ! in_array( 'commentsdiv', $hidden ) ) {
if ( ! in_array( 'commentsdiv', $hidden, true ) ) {
?>
<script type="text/javascript">jQuery(document).ready(function(){commentsBox.get(<?php echo $total; ?>, 10);});</script>
<?php
......@@ -1182,7 +1182,7 @@ function xfn_check( $class, $value = '', $deprecated = '' ) {
$link_rel = isset( $link->link_rel ) ? $link->link_rel : ''; // In PHP 5.3: $link_rel = $link->link_rel ?: '';
$rels = preg_split( '/\s+/', $link_rel );
if ( '' != $value