Changeset 38420
- Timestamp:
- 08/28/2016 05:14:52 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/pluggable.php
r38411 r38420 1081 1081 */ 1082 1082 function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { 1083 if ( -1 == $action ) { 1084 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '4.7' ); 1085 } 1086 1083 1087 $nonce = ''; 1084 1088 -
trunk/tests/phpunit/tests/auth.php
r38398 r38420 150 150 } 151 151 152 /** 153 * @ticket 36361 154 */ 155 public function test_check_admin_referer_with_no_action_triggers_doing_it_wrong() { 156 $this->setExpectedIncorrectUsage( 'check_admin_referer' ); 157 158 // A valid nonce needs to be set so the check doesn't die() 159 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 160 $result = check_admin_referer(); 161 $this->assertSame( 1, $result ); 162 163 unset( $_REQUEST['_wpnonce'] ); 164 } 165 166 /** 167 * @ticket 36361 168 */ 169 public function test_check_ajax_referer_with_no_action_triggers_doing_it_wrong() { 170 $this->setExpectedIncorrectUsage( 'check_ajax_referer' ); 171 172 // A valid nonce needs to be set so the check doesn't die() 173 $_REQUEST['_wpnonce'] = wp_create_nonce( -1 ); 174 $result = check_ajax_referer(); 175 $this->assertSame( 1, $result ); 176 177 unset( $_REQUEST['_wpnonce'] ); 178 } 179 152 180 function test_password_length_limit() { 153 181 $limit = str_repeat( 'a', 4096 );
Note: See TracChangeset
for help on using the changeset viewer.