Changeset 46503 for branches/3.9/src/wp-includes/pluggable.php
- Timestamp:
- 10/14/2019 07:26:08 PM (7 years ago)
- File:
-
- 1 edited
-
branches/3.9/src/wp-includes/pluggable.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.9/src/wp-includes/pluggable.php
r45986 r46503 1007 1007 * @param string $query_arg where to look for nonce in $_REQUEST (since 2.5) 1008 1008 */ 1009 function check_admin_referer( $action = -1, $query_arg = '_wpnonce') {1010 if ( -1 == $action )1011 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2 ' );1009 function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) { 1010 if ( -1 === $action ) 1011 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1012 1012 1013 1013 $adminurl = strtolower(admin_url()); … … 1028 1028 */ 1029 1029 do_action( 'check_admin_referer', $action, $result ); 1030 1031 if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) { 1032 wp_nonce_ays( $action ); 1033 die(); 1034 } 1035 1030 1036 return $result; 1031 1037 } … … 1042 1048 */ 1043 1049 function check_ajax_referer( $action = -1, $query_arg = false, $die = true ) { 1050 if ( -1 === $action ) 1051 _doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' ); 1052 1044 1053 $nonce = ''; 1045 1054 … … 2220 2229 } 2221 2230 endif; 2222 2223 if ( ! function_exists( 'hash_equals' ) ) :2224 /**2225 * Compare two strings in constant time.2226 *2227 * This function is NOT pluggable. It is in this file (in addition to2228 * compat.php) to prevent errors if, during an update, pluggable.php2229 * copies over but compat.php does not.2230 *2231 * This function was added in PHP 5.6.2232 * It can leak the length of a string.2233 *2234 * @since 3.9.22235 *2236 * @param string $a Expected string.2237 * @param string $b Actual string.2238 * @return bool Whether strings are equal.2239 */2240 function hash_equals( $a, $b ) {2241 $a_length = strlen( $a );2242 if ( $a_length !== strlen( $b ) ) {2243 return false;2244 }2245 $result = 0;2246 2247 // Do not attempt to "optimize" this.2248 for ( $i = 0; $i < $a_length; $i++ ) {2249 $result |= ord( $a[ $i ] ) ^ ord( $b[ $i ] );2250 }2251 2252 return $result === 0;2253 }2254 endif;
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)