diff -r 3d4e9c994f10 -r a86126ab1dd4 wp/wp-admin/network/site-settings.php --- a/wp/wp-admin/network/site-settings.php Tue Oct 22 16:11:46 2019 +0200 +++ b/wp/wp-admin/network/site-settings.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.' ) ); @@ -34,7 +34,7 @@ $is_main_site = is_main_site( $id ); -if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) { +if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] && is_array( $_POST['option'] ) ) { check_admin_referer( 'edit-site' ); switch_to_blog( $id ); @@ -43,8 +43,8 @@ foreach ( (array) $_POST['option'] as $key => $val ) { $key = wp_unslash( $key ); $val = wp_unslash( $val ); - if ( $key === 0 || is_array( $val ) || in_array( $key, $skip_options ) ) { - continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options + if ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) { + continue; // Avoids "0 is a protected WP option and may not be modified" error when editing blog options. } update_option( $key, $val ); } @@ -74,18 +74,18 @@ if ( isset( $_GET['update'] ) ) { $messages = array(); - if ( 'updated' == $_GET['update'] ) { + if ( 'updated' === $_GET['update'] ) { $messages[] = __( 'Site options 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'; ?> @@ -123,12 +123,15 @@ '%' . $wpdb->esc_like( 'user_roles' ) ); $options = $wpdb->get_results( $query ); + foreach ( $options as $option ) { - if ( $option->option_name == 'default_role' ) { + if ( 'default_role' === $option->option_name ) { $editblog_default_role = $option->option_value; } + $disabled = false; $class = 'all-options'; + if ( is_serialized( $option->option_value ) ) { if ( is_serialized_string( $option->option_value ) ) { $option->option_value = esc_html( maybe_unserialize( $option->option_value ) ); @@ -138,6 +141,7 @@ $class = 'all-options disabled'; } } + if ( strpos( $option->option_value, "\n" ) !== false ) { ?> @@ -149,7 +153,7 @@ ?> - option_name, array( 'siteurl', 'home' ) ) ) { ?> + option_name, array( 'siteurl', 'home' ), true ) ) { ?> option_value ); ?> /> @@ -157,7 +161,8 @@