mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@54449 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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 = '<input type="hidden" name="_wp_http_referer" value="' . esc_attr( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '" />';
|
||||
$request_url = remove_query_arg( '_wp_http_referer' );
|
||||
$referer_field = '<input type="hidden" name="_wp_http_referer" value="' . esc_url( $request_url ) . '" />';
|
||||
|
||||
if ( $echo ) {
|
||||
echo $referer_field;
|
||||
|
||||
Reference in New Issue
Block a user