REST API: Change nonce name to _wpnonce.

It's shorter and is compatible with the default name in `wp_nonce_field()`.

Props danielbachhuber.
Fixes #34375.
Built from https://develop.svn.wordpress.org/trunk@35323


git-svn-id: http://core.svn.wordpress.org/trunk@35289 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2015-10-21 08:14:24 +00:00
parent da157f16b1
commit 116f59af60
2 changed files with 3 additions and 3 deletions

View File

@ -575,8 +575,8 @@ function rest_cookie_check_errors( $result ) {
// Determine if there is a nonce.
$nonce = null;
if ( isset( $_REQUEST['_wp_rest_nonce'] ) ) {
$nonce = $_REQUEST['_wp_rest_nonce'];
if ( isset( $_REQUEST['_wpnonce'] ) ) {
$nonce = $_REQUEST['_wpnonce'];
} elseif ( isset( $_SERVER['HTTP_X_WP_NONCE'] ) ) {
$nonce = $_SERVER['HTTP_X_WP_NONCE'];
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-35322';
$wp_version = '4.4-alpha-35323';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.