Changeset 47853
- Timestamp:
- 05/24/2020 09:14:21 AM (5 years ago)
- Location:
- trunk/src/wp-admin/network
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/plugin-install.php
r47198 r47853 8 8 */ 9 9 10 if ( isset( $_GET['tab'] ) && ( 'plugin-information' == $_GET['tab'] ) ) {10 if ( isset( $_GET['tab'] ) && ( 'plugin-information' === $_GET['tab'] ) ) { 11 11 define( 'IFRAME_REQUEST', true ); 12 12 } -
trunk/src/wp-admin/network/settings.php
r47616 r47853 33 33 wp_redirect( network_admin_url( $redirect ) ); 34 34 exit; 35 } elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' == $_GET['dismiss'] ) {35 } elseif ( ! empty( $_GET['dismiss'] ) && 'new_network_admin_email' === $_GET['dismiss'] ) { 36 36 check_admin_referer( 'dismiss_new_network_admin_email' ); 37 37 delete_site_option( 'network_admin_hash' ); … … 256 256 $limited_email_domains = get_site_option( 'limited_email_domains' ); 257 257 $limited_email_domains = str_replace( ' ', "\n", $limited_email_domains ); 258 259 if ( $limited_email_domains ) { 260 $limited_email_domains = implode( "\n", (array) $limited_email_domains ); 261 } 258 262 ?> 259 263 <textarea name="limited_email_domains" id="limited_email_domains" aria-describedby="limited-email-domains-desc" cols="45" rows="5"> 260 <?php echo esc_textarea( '' == $limited_email_domains ? '' : implode( "\n", (array) $limited_email_domains )); ?></textarea>264 <?php echo esc_textarea( $limited_email_domains ); ?></textarea> 261 265 <p class="description" id="limited-email-domains-desc"> 262 266 <?php _e( 'If you want to limit site registrations to certain domains. One domain per line.' ); ?> … … 268 272 <th scope="row"><label for="banned_email_domains"><?php _e( 'Banned Email Domains' ); ?></label></th> 269 273 <td> 274 <?php 275 $banned_email_domains = get_site_option( 'banned_email_domains' ); 276 277 if ( $banned_email_domains ) { 278 $banned_email_domains = implode( "\n", (array) $banned_email_domains ); 279 } 280 ?> 270 281 <textarea name="banned_email_domains" id="banned_email_domains" aria-describedby="banned-email-domains-desc" cols="45" rows="5"> 271 <?php echo esc_textarea( get_site_option( 'banned_email_domains' ) == '' ? '' : implode( "\n", (array) get_site_option( 'banned_email_domains' ) )); ?></textarea>282 <?php echo esc_textarea( $banned_email_domains ); ?></textarea> 272 283 <p class="description" id="banned-email-domains-desc"> 273 284 <?php _e( 'If you want to ban domains from site registrations. One domain per line.' ); ?> -
trunk/src/wp-admin/network/site-info.php
r47557 r47853 36 36 $is_main_site = is_main_site( $id ); 37 37 38 if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) {38 if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) { 39 39 check_admin_referer( 'edit-site' ); 40 40 … … 118 118 if ( isset( $_GET['update'] ) ) { 119 119 $messages = array(); 120 if ( 'updated' == $_GET['update'] ) {120 if ( 'updated' === $_GET['update'] ) { 121 121 $messages[] = __( 'Site info updated.' ); 122 122 } -
trunk/src/wp-admin/network/site-new.php
r47606 r47853 34 34 ); 35 35 36 if ( isset( $_REQUEST['action'] ) && 'add-site' == $_REQUEST['action'] ) {36 if ( isset( $_REQUEST['action'] ) && 'add-site' === $_REQUEST['action'] ) { 37 37 check_admin_referer( 'add-blog', '_wpnonce_add-blog' ); 38 38 … … 140 140 $id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() ); 141 141 $wpdb->show_errors(); 142 142 143 if ( ! is_wp_error( $id ) ) { 143 144 if ( ! is_super_admin( $user_id ) && ! get_user_option( 'primary_blog', $user_id ) ) { … … 188 189 if ( isset( $_GET['update'] ) ) { 189 190 $messages = array(); 190 if ( 'added' == $_GET['update'] ) {191 if ( 'added' === $_GET['update'] ) { 191 192 $messages[] = sprintf( 192 193 /* translators: 1: Dashboard URL, 2: Network admin edit URL. */ -
trunk/src/wp-admin/network/site-settings.php
r47550 r47853 35 35 $is_main_site = is_main_site( $id ); 36 36 37 if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] && is_array( $_POST['option'] ) ) {37 if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] && is_array( $_POST['option'] ) ) { 38 38 check_admin_referer( 'edit-site' ); 39 39 … … 45 45 $val = wp_unslash( $val ); 46 46 if ( 0 === $key || is_array( $val ) || in_array( $key, $skip_options, true ) ) { 47 continue; // Avoids "0 is a protected WP option and may not be modified" error when edit blog options.47 continue; // Avoids "0 is a protected WP option and may not be modified" error when editing blog options. 48 48 } 49 49 update_option( $key, $val ); … … 75 75 if ( isset( $_GET['update'] ) ) { 76 76 $messages = array(); 77 if ( 'updated' == $_GET['update'] ) {77 if ( 'updated' === $_GET['update'] ) { 78 78 $messages[] = __( 'Site options updated.' ); 79 79 } … … 124 124 ); 125 125 $options = $wpdb->get_results( $query ); 126 126 127 foreach ( $options as $option ) { 127 128 if ( 'default_role' === $option->option_name ) { 128 129 $editblog_default_role = $option->option_value; 129 130 } 131 130 132 $disabled = false; 131 133 $class = 'all-options'; 134 132 135 if ( is_serialized( $option->option_value ) ) { 133 136 if ( is_serialized_string( $option->option_value ) ) { … … 139 142 } 140 143 } 144 141 145 if ( strpos( $option->option_value, "\n" ) !== false ) { 142 146 ?> … … 159 163 } 160 164 } // End foreach. 165 161 166 /** 162 167 * Fires at the end of the Edit Site form, before the submit button. -
trunk/src/wp-admin/network/site-themes.php
r47198 r47853 159 159 } 160 160 161 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {161 if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) { 162 162 wp_safe_redirect( $referer ); 163 163 exit(); … … 189 189 if ( isset( $_GET['enabled'] ) ) { 190 190 $enabled = absint( $_GET['enabled'] ); 191 if ( 1 == $enabled ) {191 if ( 1 === $enabled ) { 192 192 $message = __( 'Theme enabled.' ); 193 193 } else { … … 198 198 } elseif ( isset( $_GET['disabled'] ) ) { 199 199 $disabled = absint( $_GET['disabled'] ); 200 if ( 1 == $disabled ) {200 if ( 1 === $disabled ) { 201 201 $message = __( 'Theme disabled.' ); 202 202 } else { … … 205 205 } 206 206 echo '<div id="message" class="updated notice is-dismissible"><p>' . sprintf( $message, number_format_i18n( $disabled ) ) . '</p></div>'; 207 } elseif ( isset( $_GET['error'] ) && 'none' == $_GET['error'] ) {207 } elseif ( isset( $_GET['error'] ) && 'none' === $_GET['error'] ) { 208 208 echo '<div id="message" class="error notice is-dismissible"><p>' . __( 'No theme selected.' ) . '</p></div>'; 209 209 } -
trunk/src/wp-admin/network/site-users.php
r47198 r47853 78 78 } else { 79 79 $update = 'newuser'; 80 80 81 /** 81 82 * Fires after a user has been created via the network site-users.php page. … … 179 180 check_admin_referer( 'bulk-users' ); 180 181 $userids = $_REQUEST['users']; 182 181 183 /** This action is documented in wp-admin/network/site-themes.php */ 182 184 $referer = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $referer, $action, $userids, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 183 $update = $action; 185 186 $update = $action; 184 187 break; 185 188 } … … 191 194 restore_current_blog(); 192 195 193 if ( isset( $_GET['action'] ) && 'update-site' == $_GET['action'] ) {196 if ( isset( $_GET['action'] ) && 'update-site' === $_GET['action'] ) { 194 197 wp_safe_redirect( $referer ); 195 198 exit(); -
trunk/src/wp-admin/network/sites.php
r47219 r47853 224 224 } 225 225 } 226 226 227 if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) { 227 228 $redirect_to = wp_get_referer(); 228 229 $blogs = (array) $_POST['allblogs']; 230 229 231 /** This action is documented in wp-admin/network/site-themes.php */ 230 232 $redirect_to = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $redirect_to, $doaction, $blogs, $id ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores 233 231 234 wp_safe_redirect( $redirect_to ); 232 235 exit(); … … 238 241 add_query_arg( $_POST, network_admin_url( 'sites.php' ) ) 239 242 ); 243 240 244 wp_redirect( $location ); 241 245 exit; … … 271 275 */ 272 276 do_action( 'deactivate_blog', $id ); 277 273 278 update_blog_status( $id, 'deleted', '1' ); 274 279 break; -
trunk/src/wp-admin/network/theme-install.php
r47198 r47853 8 8 */ 9 9 10 if ( isset( $_GET['tab'] ) && ( 'theme-information' == $_GET['tab'] ) ) {10 if ( isset( $_GET['tab'] ) && ( 'theme-information' === $_GET['tab'] ) ) { 11 11 define( 'IFRAME_REQUEST', true ); 12 12 } -
trunk/src/wp-admin/network/user-new.php
r47198 r47853 31 31 ); 32 32 33 if ( isset( $_REQUEST['action'] ) && 'add-user' == $_REQUEST['action'] ) {33 if ( isset( $_REQUEST['action'] ) && 'add-user' === $_REQUEST['action'] ) { 34 34 check_admin_referer( 'add-user', '_wpnonce_add-user' ); 35 35 … … 45 45 46 46 $user_details = wpmu_validate_user_signup( $user['username'], $user['email'] ); 47 47 48 if ( is_wp_error( $user_details['errors'] ) && $user_details['errors']->has_errors() ) { 48 49 $add_user_errors = $user_details['errors']; … … 62 63 */ 63 64 do_action( 'network_user_new_created_user', $user_id ); 65 64 66 wp_redirect( 65 67 add_query_arg( … … 78 80 if ( isset( $_GET['update'] ) ) { 79 81 $messages = array(); 80 if ( 'added' == $_GET['update'] ) {82 if ( 'added' === $_GET['update'] ) { 81 83 $edit_link = ''; 82 84 if ( isset( $_GET['user_id'] ) ) { -
trunk/src/wp-admin/network/users.php
r47219 r47853 28 28 29 29 $id = intval( $_GET['id'] ); 30 if ( '0' != $id && '1' != $id) {30 if ( $id > 1 ) { 31 31 $_POST['allusers'] = array( $id ); // confirm_delete_users() can only handle arrays. 32 32 $title = __( 'Users' ); … … 117 117 if ( ! in_array( $doaction, array( 'delete', 'spam', 'notspam' ), true ) ) { 118 118 $sendback = wp_get_referer(); 119 120 119 $user_ids = (array) $_POST['allusers']; 120 121 121 /** This action is documented in wp-admin/network/site-themes.php */ 122 122 $sendback = apply_filters( 'handle_network_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $user_ids ); // phpcs:ignore WordPress.NamingConventions.ValidHookName.UseUnderscores … … 158 158 } 159 159 160 if ( ! empty( $_POST['delete'] ) && 'reassign' == $_POST['delete'][ $blogid ][ $id ] ) {160 if ( ! empty( $_POST['delete'] ) && 'reassign' === $_POST['delete'][ $blogid ][ $id ] ) { 161 161 remove_user_from_blog( $id, $blogid, (int) $user_id ); 162 162 } else { … … 166 166 } 167 167 } 168 168 169 $i = 0; 170 169 171 if ( is_array( $_POST['user'] ) && ! empty( $_POST['user'] ) ) { 170 172 foreach ( $_POST['user'] as $id ) { … … 177 179 } 178 180 179 if ( 1 == $i ) {181 if ( 1 === $i ) { 180 182 $deletefunction = 'delete'; 181 183 } else {
Note: See TracChangeset
for help on using the changeset viewer.