Skip to content
Permalink
Browse files

Administration: Ensure that admin referer nonce is valid.

Coding standards, ensure that nonce is valid with identical, rather then equal operator.

Props vortfu, xknown, whyisjake.

Built from https://develop.svn.wordpress.org/trunk@46477


git-svn-id: http://core.svn.wordpress.org/trunk@46275 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information...
whyisjake committed Oct 14, 2019
1 parent 2524ba3 commit b183fd1cca0b44a92f0264823dd9f22d2fd8b8d0
Showing with 3 additions and 3 deletions.
  1. +2 −2 wp-includes/pluggable.php
  2. +1 −1 wp-includes/version.php
@@ -1106,7 +1106,7 @@ function auth_redirect() {
* 0-12 hours ago, 2 if the nonce is valid and generated between 12-24 hours ago.
*/
function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
if ( -1 == $action ) {
if ( -1 === $action ) {
_doing_it_wrong( __FUNCTION__, __( 'You should specify a nonce action to be verified by using the first parameter.' ), '3.2.0' );
}
@@ -1125,7 +1125,7 @@ function check_admin_referer( $action = -1, $query_arg = '_wpnonce' ) {
*/
do_action( 'check_admin_referer', $action, $result );
if ( ! $result && ! ( -1 == $action && strpos( $referer, $adminurl ) === 0 ) ) {
if ( ! $result && ! ( -1 === $action && strpos( $referer, $adminurl ) === 0 ) ) {
wp_nonce_ays( $action );
die();
}
@@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.3-beta3-46476';
$wp_version = '5.3-beta3-46477';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

0 comments on commit b183fd1

Please sign in to comment.
You can’t perform that action at this time.