WordPress.org

Make WordPress Core

Ticket #12657: clipboard.patch

File clipboard.patch, 876 bytes (added by hakre, 4 years ago)

Only use filter once

  • wp-includes/user.php

    ### Eclipse Workspace Patch 1.0
    #P wordpress
     
    4343        if ( '' === $secure_cookie ) 
    4444                $secure_cookie = is_ssl(); 
    4545 
    46         global $auth_secure_cookie; // XXX ugly hack to pass this to wp_authenticate_cookie 
    47         $auth_secure_cookie = $secure_cookie; 
    48  
    49         add_filter('authenticate', 'wp_authenticate_cookie', 30, 3); 
    50  
     46        static $needs_filter = true; 
     47        global $auth_secure_cookie; 
     48        $auth_secure_cookie = $secure_cookie; // pass this to wp_authenticate_cookie 
     49        if ( $needs_filter ) { 
     50                add_filter('authenticate', 'wp_authenticate_cookie', 30, 3); 
     51                $needs_filter = false; 
     52        } 
    5153        $user = wp_authenticate($credentials['user_login'], $credentials['user_password']); 
    5254 
    5355        if ( is_wp_error($user) ) {