Changeset 33744
- Timestamp:
- 08/26/2015 12:05:11 AM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r33743 r33744 1813 1813 } 1814 1814 1815 /** 1816 * Fires when nonce verification fails. 1817 * 1818 * @since 4.4.0 1819 * 1820 * @param string $nonce The invalid nonce. 1821 * @param string|int $action The nonce action. 1822 * @param WP_User $user The current user object. 1823 * @param string $token The user's session token. 1824 */ 1825 do_action( 'wp_verify_nonce_failed', $nonce, $action, $user, $token ); 1826 1815 1827 // Invalid nonce 1816 1828 return false; -
trunk/tests/phpunit/tests/auth.php
r33019 r33744 9 9 var $wp_hasher; 10 10 11 /** 12 * action hook 13 */ 14 protected $nonce_failure_hook = 'wp_verify_nonce_failed'; 15 11 16 function setUp() { 12 17 parent::setUp(); … … 111 116 } 112 117 118 /** 119 * @ticket 24030 120 */ 121 function test_wp_nonce_verify_failed() { 122 $nonce = substr( md5( uniqid() ), 0, 10 ); 123 $count = did_action( $this->nonce_failure_hook ); 124 125 wp_verify_nonce( $nonce, 'nonce_test_action' ); 126 127 $this->assertEquals( ( $count + 1 ), did_action( $this->nonce_failure_hook ) ); 128 } 129 130 /** 131 * @ticket 24030 132 */ 133 function test_wp_nonce_verify_success() { 134 $nonce = wp_create_nonce( 'nonce_test_action' ); 135 $count = did_action( $this->nonce_failure_hook ); 136 137 wp_verify_nonce( $nonce, 'nonce_test_action' ); 138 139 $this->assertEquals( $count, did_action( $this->nonce_failure_hook ) ); 140 } 141 113 142 function test_password_length_limit() { 114 143 $passwords = array(
Note: See TracChangeset
for help on using the changeset viewer.