WordPress.org

Make WordPress Core

Changeset 6345


Ignore:
Timestamp:
11/27/07 08:03:33 (6 years ago)
Author:
ryan
Message:

Check if REQUEST_METHOD is POST rather than cheecking if _POST is empty to determine if we were called via POST. Props xknown. fixes #5365

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-login.php

    r6343 r6345  
    6969} // End of login_header() 
    7070 
    71  
     71$http_post = ('POST' == $_SERVER['REQUEST_METHOD']); 
    7272switch ($action) { 
    7373 
     
    9191    $user_pass = ''; 
    9292 
    93     if ( $_POST ) { 
     93    if ( $http_post ) { 
    9494        if ( empty( $_POST['user_login'] ) ) 
    9595            $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.'); 
     
    213213    } 
    214214 
    215     if ( $_POST ) { 
     215    if ( $http_post ) { 
    216216        require_once( ABSPATH . WPINC . '/registration.php'); 
    217217 
     
    296296        $redirect_to = $_REQUEST['redirect_to']; 
    297297 
    298     if ( $_POST ) { 
     298    if ( $http_post ) { 
    299299        $user_login = $_POST['log']; 
    300300        $user_login = sanitize_user( $user_login ); 
     
    313313 
    314314    // If cookies are disabled we can't log in even with a valid user+pass 
    315     if ( $_POST && empty($_COOKIE[TEST_COOKIE]) ) 
     315    if ( $http_post && empty($_COOKIE[TEST_COOKIE]) ) 
    316316        $errors['test_cookie'] = __('<strong>ERROR</strong>: WordPress requires Cookies but your browser does not support them or they are blocked.'); 
    317317 
     
    335335    } 
    336336 
    337     if ( $_POST && empty( $user_login ) ) 
     337    if ( $http_post && empty( $user_login ) ) 
    338338        $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.'); 
    339     if ( $_POST && empty( $user_pass ) ) 
     339    if ( $http_post && empty( $user_pass ) ) 
    340340        $errors['user_pass'] = __('<strong>ERROR</strong>: The password field is empty.'); 
    341341 
Note: See TracChangeset for help on using the changeset viewer.