Changeset 46477
- Timestamp:
- 10/14/2019 03:38:14 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r46472 r46477 1107 1107 */ 1108 1108 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 1109 if ( -1 == $action ) {1109 if ( -1 === $action ) { 1110 1110 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1111 1111 } … … 1126 1126 do_action( 'check_admin_referer', $action, $result ); 1127 1127 1128 if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {1128 if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { 1129 1129 wp_nonce_ays( $action ); 1130 1130 die(); -
trunk/tests/phpunit/tests/auth.php
r45717 r46477 25 25 self::$user_id = self::$_user->ID; 26 26 27 require_once ( ABSPATH . WPINC . '/class-phpass.php' );27 require_once ABSPATH . WPINC . '/class-phpass.php'; 28 28 self::$wp_hasher = new PasswordHash( 8, true ); 29 29 } … … 166 166 } 167 167 168 public function test_check_admin_referer_with_default_action_as_string_not_doing_it_wrong() { 169 $this->setExpectedIncorrectUsage( 'check_admin_referer' ); 170 // A valid nonce needs to be set so the check doesn't die() 171 $_REQUEST['_wpnonce'] = wp_create_nonce( '-1' ); 172 $result = check_admin_referer( '-1' ); 173 $this->assertSame( 1, $result ); 174 175 unset( $_REQUEST['_wpnonce'] ); 176 } 177 168 178 /** 169 179 * @ticket 36361
Note: See TracChangeset
for help on using the changeset viewer.