From b0a327cf3c863cd7450b314cbbbe9eb03074fe98 Mon Sep 17 00:00:00 2001 From: Joe Hoyle Date: Sun, 7 May 2017 04:09:41 +0000 Subject: [PATCH] REST API: WP_REST_Request::remove_header() should canonicalize header names. When headers are stored in WP_REST_Request internally they are canonicalized. This step already happens on setting / getting headers in any way, but was missed when implementing remove_header(). Props TimothyBlynJacobs. Fixes #40347. Built from https://develop.svn.wordpress.org/trunk@40577 git-svn-id: http://core.svn.wordpress.org/trunk@40447 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/rest-api/class-wp-rest-request.php | 1 + wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 74a81c92e8..0a26d0fe3d 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -286,6 +286,7 @@ class WP_REST_Request implements ArrayAccess { * @param string $key Header name. */ public function remove_header( $key ) { + $key = $this->canonicalize_header_name( $key ); unset( $this->headers[ $key ] ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index caec658073..1d42c20ca4 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40576'; +$wp_version = '4.8-alpha-40577'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.