Make WordPress Core


Ignore:
Timestamp:
03/30/2016 02:49:22 PM (10 years ago)
Author:
ocean90
Message:

Multisite: Validate new email address confirmations.

Merge of [37103] to the 3.8 branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.8/src/wp-admin/user-edit.php

    r26937 r37110  
    9999if ( is_multisite() && IS_PROFILE_PAGE && isset( $_GET[ 'newuseremail' ] ) && $current_user->ID ) {
    100100    $new_email = get_option( $current_user->ID . '_new_email' );
    101     if ( $new_email[ 'hash' ] == $_GET[ 'newuseremail' ] ) {
     101    if ( $new_email && hash_equals( $new_email[ 'hash' ], $_GET[ 'newuseremail' ] ) ) {
    102102        $user = new stdClass;
    103103        $user->ID = $current_user->ID;
     
    110110        die();
    111111    }
    112 } elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' == $_GET['dismiss'] ) {
     112} elseif ( is_multisite() && IS_PROFILE_PAGE && !empty( $_GET['dismiss'] ) && $current_user->ID . '_new_email' === $_GET['dismiss'] ) {
     113    check_admin_referer( 'dismiss-' . $current_user->ID . '_new_email' );
    113114    delete_option( $current_user->ID . '_new_email' );
    114115    wp_redirect( add_query_arg( array('updated' => 'true'), self_admin_url( 'profile.php' ) ) );
     
    407408    if ( $new_email && $new_email['newemail'] != $current_user->user_email && $profileuser->ID == $current_user->ID ) : ?>
    408409    <div class="updated inline">
    409     <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), $new_email['newemail'], esc_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ) ) ); ?></p>
     410    <p><?php printf( __('There is a pending change of your e-mail to <code>%1$s</code>. <a href="%2$s">Cancel</a>'), esc_html( $new_email['newemail'] ), esc_url( wp_nonce_url( self_admin_url( 'profile.php?dismiss=' . $current_user->ID . '_new_email' ), 'dismiss-' . $current_user->ID . '_new_email' ) ) ); ?></p>
    410411    </div>
    411412    <?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.