Make WordPress Core

Ticket #46349: 46349.5.diff

File 46349.5.diff, 2.5 KB (added by azaozz, 5 years ago)
  • src/wp-admin/includes/schema.php

     
    542542
    543543                // 4.9.8
    544544                'show_comments_cookies_opt_in'    => 1,
     545
     546                // 5.3.0
     547                'admin_email_lifespan'            => ( time() + 6 * MONTH_IN_SECONDS ),
    545548        );
    546549
    547550        // 3.3
  • src/wp-admin/includes/upgrade.php

     
    21252125 * @since 5.3.0
    21262126 */
    21272127function upgrade_530() {
    2128         // Do `add_option()` rather than overwriting with `update_option()` as this may run
    2129         // after an admin was redirected to the email verification screen,
    2130         // and the option was updated.
    2131         add_option( 'admin_email_lifespan', 0 );
     2128        // The `admin_email_lifespan` option may have been set by an admin that just logged in,
     2129        // saw the verification screen, clicked on a button there, and is now upgrading the db,
     2130        // or by populate_options() that is called earlier in upgrade_all().
     2131        // In the second case `admin_email_lifespan` should be reset so the verification screen
     2132        // is shown next time an admin logs in.
     2133        if ( function_exists( 'current_user_can' ) && ! current_user_can( 'manage_options' ) ) {
     2134                update_option( 'admin_email_lifespan', 0 );
     2135        }
    21322136}
    21332137
    21342138/**
  • src/wp-login.php

     
    594594                         *
    595595                         * @param int Interval time (in seconds).
    596596                         */
    597                         $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 180 * DAY_IN_SECONDS );
     597                        $admin_email_check_interval = (int) apply_filters( 'admin_email_check_interval', 6 * MONTH_IN_SECONDS );
    598598
    599599                        if ( $admin_email_check_interval > 0 ) {
    600600                                update_option( 'admin_email_lifespan', time() + $admin_email_check_interval );
     
    617617
    618618                ?>
    619619
    620                 <form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( network_site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post">
     620                <form class="admin-email-confirm-form" name="admin-email-confirm-form" action="<?php echo esc_url( site_url( 'wp-login.php?action=confirm_admin_email', 'login_post' ) ); ?>" method="post">
    621621                        <?php
    622622                        /**
    623623                        * Fires inside the admin-email-confirm-form form tags, before the hidden fields.