From 4417e75e2c7368a2ee06a3bb95e6916f32411860 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Tue, 2 Sep 2014 04:48:17 +0000 Subject: [PATCH] Canonical: Apply redirects to HEAD requests too. Adjusts [28958]. props SergeyBiryukov. fixes #27498. Built from https://develop.svn.wordpress.org/trunk@29663 git-svn-id: http://core.svn.wordpress.org/trunk@29437 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/canonical.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-includes/canonical.php b/wp-includes/canonical.php index a4a56ec445..c1b90251cf 100644 --- a/wp-includes/canonical.php +++ b/wp-includes/canonical.php @@ -39,7 +39,7 @@ function redirect_canonical( $requested_url = null, $do_redirect = true ) { global $wp_rewrite, $is_IIS, $wp_query, $wpdb; - if ( isset( $_SERVER['REQUEST_METHOD'] ) && 'GET' !== $_SERVER['REQUEST_METHOD'] ) { + if ( isset( $_SERVER['REQUEST_METHOD'] ) && ! in_array( strtoupper( $_SERVER['REQUEST_METHOD'] ), array( 'GET', 'HEAD' ) ) ) { return; }