Make WordPress Core

Ticket #52976: 52976.1.patch

File 52976.1.patch, 8.3 KB (added by lgadzhev, 3 years ago)

Updating the patch because the old one wasn't compatible with the latest WP version

  • src/wp-admin/includes/misc.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/includes/misc.php b/src/wp-admin/includes/misc.php
    a b  
    14101410 * @param string $value     The proposed new site admin email address.
    14111411 */
    14121412function update_option_new_admin_email( $old_value, $value ) {
    1413         if ( get_option( 'admin_email' ) === $value || ! is_email( $value ) ) {
     1413        if ( 0 === strcasecmp( get_option( 'admin_email' ), $value ) || ! is_email( $value ) ) {
    14141414                return;
    14151415        }
    14161416
  • src/wp-admin/includes/class-wp-screen.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/includes/class-wp-screen.php b/src/wp-admin/includes/class-wp-screen.php
    a b  
    11261126                                update_user_meta( get_current_user_id(), 'show_welcome_panel', $welcome_checked );
    11271127                        } else {
    11281128                                $welcome_checked = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    1129                                 if ( 2 === $welcome_checked && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) {
     1129                                if ( 2 === $welcome_checked && 0 !== strcasecmp( wp_get_current_user()->user_email, get_option( 'admin_email' ) ) ) {
    11301130                                        $welcome_checked = false;
    11311131                                }
    11321132                        }
  • src/wp-includes/ms-functions.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php
    a b  
    28022802 * @param string $value     The proposed new network admin email address.
    28032803 */
    28042804function update_network_option_new_admin_email( $old_value, $value ) {
    2805         if ( get_site_option( 'admin_email' ) === $value || ! is_email( $value ) ) {
     2805        if ( 0 === strcasecmp( get_site_option( 'admin_email' ), $value ) || ! is_email( $value ) ) {
    28062806                return;
    28072807        }
    28082808
  • src/wp-admin/includes/class-wp-automatic-updater.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/includes/class-wp-automatic-updater.php b/src/wp-admin/includes/class-wp-automatic-updater.php
    a b  
    258258
    259259                // Don't notify if we've already notified the same email address of the same version.
    260260                if ( $notified
    261                         && get_site_option( 'admin_email' ) === $notified['email']
     261                        && 0 === strcasecmp( get_site_option( 'admin_email' ), $notified['email'] )
    262262                        && $notified['version'] === $item->current
    263263                ) {
    264264                        return false;
     
    636636                // Don't notify if we've already notified the same email address of the same version of the same notification type.
    637637                if ( $notified
    638638                        && 'fail' === $notified['type']
    639                         && get_site_option( 'admin_email' ) === $notified['email']
     639                        && 0 === strcasecmp( get_site_option( 'admin_email' ), $notified['email'] )
    640640                        && $notified['version'] === $core_update->current
    641641                ) {
    642642                        $send = false;
  • src/wp-admin/user-edit.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/user-edit.php b/src/wp-admin/user-edit.php
    a b  
    519519                                                        <?php endif; ?>
    520520
    521521                                                        <?php $new_email = get_user_meta( $current_user->ID, '_new_email', true ); ?>
    522                                                         <?php if ( $new_email && $new_email['newemail'] !== $current_user->user_email && $profile_user->ID === $current_user->ID ) : ?>
     522                                                        <?php if ( $new_email && 0 !== strcasecmp( $new_email['newemail'], $current_user->user_email ) && $profile_user->ID === $current_user->ID ) : ?>
    523523                                                        <div class="updated inline">
    524524                                                                <p>
    525525                                                                        <?php
  • src/wp-admin/options-general.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/options-general.php b/src/wp-admin/options-general.php
    a b  
    114114<p class="description" id="new-admin-email-description"><?php _e( 'This address is used for admin purposes. If you change this, an email will be sent to your new address to confirm it. <strong>The new address will not become active until confirmed.</strong>' ); ?></p>
    115115<?php
    116116$new_admin_email = get_option( 'new_admin_email' );
    117 if ( $new_admin_email && get_option( 'admin_email' ) !== $new_admin_email ) :
     117if ( $new_admin_email && 0 !== strcasecmp( get_option( 'admin_email' ), $new_admin_email ) ) :
    118118        ?>
    119119        <div class="updated inline">
    120120        <p>
  • src/wp-admin/_index.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/_index.php b/src/wp-admin/_index.php
    a b  
    175175
    176176        $option = (int) get_user_meta( get_current_user_id(), 'show_welcome_panel', true );
    177177        // 0 = hide, 1 = toggled to show or single site creator, 2 = multisite site owner.
    178         $hide = ( 0 === $option || ( 2 === $option && wp_get_current_user()->user_email !== get_option( 'admin_email' ) ) );
     178        $hide = ( 0 === $option || ( 2 === $option && 0 !== strcasecmp( wp_get_current_user()->user_email, get_option( 'admin_email' ) ) ) );
    179179        if ( $hide ) {
    180180                $classes .= ' hidden';
    181181        }
  • src/wp-includes/user.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
    a b  
    23322332        }
    23332333
    23342334        if ( $update ) {
    2335                 if ( $user_email !== $old_user_data->user_email || $user_pass !== $old_user_data->user_pass ) {
     2335                if ( 0 !== strcasecmp( $user_email, $old_user_data->user_email ) || $user_pass !== $old_user_data->user_pass ) {
    23362336                        $data['user_activation_key'] = '';
    23372337                }
    23382338                $wpdb->update( $wpdb->users, $data, array( 'ID' => $user_id ) );
     
    25312531                $send_password_change_email = apply_filters( 'send_password_change_email', true, $user, $userdata );
    25322532        }
    25332533
    2534         if ( isset( $userdata['user_email'] ) && $user['user_email'] !== $userdata['user_email'] ) {
     2534        if ( isset( $userdata['user_email'] ) && 0 !== strcasecmp( $user['user_email'], $userdata['user_email'] ) ) {
    25352535                /**
    25362536                 * Filters whether to send the email change email.
    25372537                 *
  • src/wp-admin/network/settings.php

    IDEA additional info:
    Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
    <+>UTF-8
    diff --git a/src/wp-admin/network/settings.php b/src/wp-admin/network/settings.php
    a b  
    166166                                        </p>
    167167                                        <?php
    168168                                        $new_admin_email = get_site_option( 'new_admin_email' );
    169                                         if ( $new_admin_email && get_site_option( 'admin_email' ) !== $new_admin_email ) :
     169                                        if ( $new_admin_email && 0 !== strcasecmp( get_site_option( 'admin_email' ), $new_admin_email ) ) :
    170170                                                ?>
    171171                                                <div class="updated inline">
    172172                                                <p>