Ticket #5365: 5365.2.diff
File 5365.2.diff, 1.9 KB (added by , 17 years ago) |
---|
-
wp-login.php
68 68 } 69 69 } // End of login_header() 70 70 71 71 $http_post = ('POST' == $_SERVER['REQUEST_METHOD']); 72 72 switch ($action) { 73 73 74 74 case 'logout' : … … 90 90 $user_login = ''; 91 91 $user_pass = ''; 92 92 93 if ( $ _POST) {93 if ( $http_post ) { 94 94 if ( empty( $_POST['user_login'] ) ) 95 95 $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.'); 96 96 if ( empty( $_POST['user_email'] ) ) … … 212 212 exit(); 213 213 } 214 214 215 if ( $ _POST) {215 if ( $http_post ) { 216 216 require_once( ABSPATH . WPINC . '/registration.php'); 217 217 218 218 $user_login = sanitize_user( $_POST['user_login'] ); … … 295 295 else 296 296 $redirect_to = $_REQUEST['redirect_to']; 297 297 298 if ( $ _POST) {298 if ( $http_post ) { 299 299 $user_login = $_POST['log']; 300 300 $user_login = sanitize_user( $user_login ); 301 301 $user_pass = $_POST['pwd']; … … 312 312 do_action_ref_array('wp_authenticate', array(&$user_login, &$user_pass)); 313 313 314 314 // 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]) ) 316 316 $errors['test_cookie'] = __('<strong>ERROR</strong>: WordPress requires Cookies but your browser does not support them or they are blocked.'); 317 317 318 318 if ( $user_login && $user_pass && empty( $errors ) ) { … … 334 334 } 335 335 } 336 336 337 if ( $ _POST&& empty( $user_login ) )337 if ( $http_post && empty( $user_login ) ) 338 338 $errors['user_login'] = __('<strong>ERROR</strong>: The username field is empty.'); 339 if ( $ _POST&& empty( $user_pass ) )339 if ( $http_post && empty( $user_pass ) ) 340 340 $errors['user_pass'] = __('<strong>ERROR</strong>: The password field is empty.'); 341 341 342 342 // Some parts of this script use the main login form to display a message