Make WordPress Core


Ignore:
Timestamp:
07/01/2015 06:32:07 AM (11 years ago)
Author:
dd32
Message:

Expire password reset links after 24 hours (by default). This causes existing password reset links to become invalid.

Props markjaquith, voldemortensen, johnbillion, MikeHansenMe, dd32
See #32429

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r32672 r33019  
    364364        $wp_hasher = new PasswordHash( 8, true );
    365365    }
    366     $hashed = $wp_hasher->HashPassword( $key );
     366    $hashed = time() . ':' . $wp_hasher->HashPassword( $key );
    367367    $wpdb->update( $wpdb->users, array( 'user_activation_key' => $hashed ), array( 'user_login' => $user_login ) );
    368368
     
    529529
    530530    if ( isset( $_GET['error'] ) ) {
    531         if ( 'invalidkey' == $_GET['error'] )
    532             $errors->add( 'invalidkey', __( 'Sorry, that key does not appear to be valid.' ) );
    533         elseif ( 'expiredkey' == $_GET['error'] )
    534             $errors->add( 'expiredkey', __( 'Sorry, that key has expired. Please try again.' ) );
     531        if ( 'invalidkey' == $_GET['error'] ) {
     532            $errors->add( 'invalidkey', __( 'Your password reset link appears to be invalid. Please request a new lnk below.' ) );
     533        } elseif ( 'expiredkey' == $_GET['error'] ) {
     534            $errors->add( 'expiredkey', __( 'Your password reset link has expired. Please request a new link below.' ) );
     535        }
    535536    }
    536537
Note: See TracChangeset for help on using the changeset viewer.