Changeset 33173 for trunk/src/wp-admin/network/sites.php
- Timestamp:
- 07/12/2015 02:35:11 AM (11 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-admin/network/sites.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/network/sites.php
r33067 r33173 53 53 do_action( 'wpmuadminedit' ); 54 54 55 // A list of valid actions and their associated messaging for confirmation output. 56 $manage_actions = array( 57 'activateblog' => __( 'You are about to activate the site %s' ), 58 'deactivateblog' => __( 'You are about to deactivate the site %s' ), 59 'unarchiveblog' => __( 'You are about to unarchive the site %s.' ), 60 'archiveblog' => __( 'You are about to archive the site %s.' ), 61 'unspamblog' => __( 'You are about to unspam the site %s.' ), 62 'spamblog' => __( 'You are about to mark the site %s as spam.' ), 63 'deleteblog' => __( 'You are about to delete the site %s.' ), 64 'unmatureblog' => __( 'You are about to mark the site %s as mature.' ), 65 'matureblog' => __( 'You are about to mark the site %s as not mature.' ), 66 'allblogs' => '', 67 ); 68 55 69 if ( 'confirm' === $_GET['action'] ) { 56 check_admin_referer( 'confirm' ); 70 // The action2 parameter contains the action being taken on the site. 71 $site_action = $_GET['action2']; 72 73 if ( ! array_key_exists( $site_action, $manage_actions ) ) { 74 wp_die( __( 'The requested action is not valid.' ) ); 75 } 76 77 // The mature/unmature UI exists only as external code. Check the "confirm" nonce for backward compatibility. 78 if ( 'matureblog' === $site_action || 'unmatureblog' === $site_action ) { 79 check_admin_referer( 'confirm' ); 80 } else { 81 check_admin_referer( $site_action . '_' . $id ); 82 } 57 83 58 84 if ( ! headers_sent() ) { … … 64 90 wp_die( __( 'You are not allowed to change the current site.' ) ); 65 91 } 92 93 $site_details = get_blog_details( $id ); 94 $site_address = untrailingslashit( $site_details->domain . $site_details->path ); 66 95 67 96 require_once( ABSPATH . 'wp-admin/admin-header.php' ); … … 69 98 <div class="wrap"> 70 99 <h1><?php _e( 'Confirm your action' ); ?></h1> 71 <form action="sites.php?action=<?php echo esc_attr( $ _GET['action2'] )?>" method="post">72 <input type="hidden" name="action" value="<?php echo esc_attr( $ _GET['action2'] )?>" />100 <form action="sites.php?action=<?php echo esc_attr( $site_action ); ?>" method="post"> 101 <input type="hidden" name="action" value="<?php echo esc_attr( $site_action ); ?>" /> 73 102 <input type="hidden" name="id" value="<?php echo esc_attr( $id ); ?>" /> 74 103 <input type="hidden" name="_wp_http_referer" value="<?php echo esc_attr( wp_get_referer() ); ?>" /> 75 <?php wp_nonce_field( $ _GET['action2'], '_wpnonce', false ); ?>76 <p><?php echo esc_html( wp_unslash( $_GET['msg'] )); ?></p>104 <?php wp_nonce_field( $site_action . '_' . $id, '_wpnonce', false ); ?> 105 <p><?php echo sprintf( $manage_actions[ $site_action ], $site_address ); ?></p> 77 106 <?php submit_button( __( 'Confirm' ), 'button' ); ?> 78 107 </form> … … 85 114 $updated_action = ''; 86 115 87 $manage_actions = array( 'deleteblog', 'allblogs', 'archiveblog', 'unarchiveblog', 'activateblog', 'deactivateblog', 'unspamblog', 'spamblog', 'unmatureblog', 'matureblog' ); 88 if ( in_array( $_GET['action'], $manage_actions ) ) { 116 if ( array_key_exists( $_GET['action'], $manage_actions ) ) { 89 117 $action = $_GET['action']; 90 if ( 'allblogs' === $action ) 118 if ( 'allblogs' === $action ) { 91 119 $action = 'bulk-sites'; 92 93 check_admin_referer( $action ); 120 } 121 122 check_admin_referer( $action . '_' . $id ); 94 123 } 95 124 … … 179 208 } 180 209 181 if ( empty( $updated_action ) && in_array( $_GET['action'], $manage_actions ) )210 if ( empty( $updated_action ) && array_key_exists( $_GET['action'], $manage_actions ) ) { 182 211 $updated_action = $_GET['action']; 212 } 183 213 184 214 if ( ! empty( $updated_action ) ) {
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)