Ticket #29542: 29542.diff
| File 29542.diff, 1.0 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/pluggable.php
1692 1692 * @param string|int $action Should give context to what is taking place and be the same when nonce was created. 1693 1693 * @return bool Whether the nonce check passed or failed. 1694 1694 */ 1695 function wp_verify_nonce($nonce, $action = -1) { 1695 function wp_verify_nonce( $nonce, $action = -1 ) { 1696 $nonce = (string) $nonce; 1696 1697 $user = wp_get_current_user(); 1697 1698 $uid = (int) $user->ID; 1698 1699 if ( ! $uid ) { -
tests/phpunit/tests/auth.php
99 99 $this->assertFalse( wp_verify_nonce( '' ) ); 100 100 $this->assertFalse( wp_verify_nonce( null ) ); 101 101 } 102 103 /** 104 * @ticket 29542 105 */ 106 function test_wp_verify_nonce_with_integer_arg() { 107 $this->assertFalse( wp_verify_nonce( 1 ) ); 108 } 102 109 }