diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/network/site-info.php --- a/wp/wp-admin/network/site-info.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/network/site-info.php Tue Dec 15 13:49:49 2020 +0100 @@ -8,7 +8,7 @@ */ /** Load WordPress Administration Bootstrap */ -require_once( dirname( __FILE__ ) . '/admin.php' ); +require_once __DIR__ . '/admin.php'; if ( ! current_user_can( 'manage_sites' ) ) { wp_die( __( 'Sorry, you are not allowed to edit this site.' ) ); @@ -35,7 +35,7 @@ $parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME ); $is_main_site = is_main_site( $id ); -if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) { +if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) { check_admin_referer( 'edit-site' ); switch_to_blog( $id ); @@ -72,8 +72,9 @@ $existing_details = get_site( $id ); $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' ); + foreach ( $blog_data_checkboxes as $c ) { - if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) { + if ( ! in_array( (int) $existing_details->$c, array( 0, 1 ), true ) ) { $blog_data[ $c ] = $existing_details->$c; } else { $blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0; @@ -116,18 +117,18 @@ if ( isset( $_GET['update'] ) ) { $messages = array(); - if ( 'updated' == $_GET['update'] ) { + if ( 'updated' === $_GET['update'] ) { $messages[] = __( 'Site info updated.' ); } } -/* translators: %s: site name */ +/* translators: %s: Site title. */ $title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) ); $parent_file = 'sites.php'; $submenu_file = 'sites.php'; -require( ABSPATH . 'wp-admin/admin-header.php' ); +require_once ABSPATH . 'wp-admin/admin-header.php'; ?> @@ -194,7 +195,7 @@