From d95f088a3e7ce07201b2824c14514c02483fc6e5 Mon Sep 17 00:00:00 2001 From: audrasjb Date: Mon, 10 Oct 2022 18:59:11 +0000 Subject: [PATCH] General: Remove instances of `_wp_http_referer` from GET forms in the admin. This changeset removes all instances of `_wp_http_referer` variable from the URL when creating a hidden input for `_wp_http_referer`. It prevents the hidden field from having an additional version of `_wp_http_referer` each time the form is submitted. Props msolution, justinahinon, pbearne, mikeschroder, mukesh27, audrasjb, Clorith, chaion07, robinwpdeveloper, hztyfoon, davidbaumwald, costdev, adamsilverstein. Fixes #54106. Built from https://develop.svn.wordpress.org/trunk@54449 git-svn-id: http://core.svn.wordpress.org/trunk@54008 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 3 ++- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 36146132d7..77aaf718b1 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -1899,7 +1899,8 @@ function wp_nonce_field( $action = -1, $name = '_wpnonce', $referer = true, $ech * @return string Referer field HTML markup. */ function wp_referer_field( $echo = true ) { - $referer_field = ''; + $request_url = remove_query_arg( '_wp_http_referer' ); + $referer_field = ''; if ( $echo ) { echo $referer_field; diff --git a/wp-includes/version.php b/wp-includes/version.php index d9db507da6..af0db8d8cd 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.1-beta3-54448'; +$wp_version = '6.1-beta3-54449'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.