Skip to content

Commit a68196e

Browse files
committed
Customize: Properly escape URLs passed by url and return parameters.
This changeset replaces `sanitize_text_field()` with `esc_url_raw()` for URLs passed via `url` and `return` query vars. This fixes an issue where the URL `example.com/หน้าภาษาไทย` would incorrectly return `example.com//` due to improper sanitization when clicking on the Customize button through the admin bar. Props okvee, yahaly, hellofromTonya, veryard, dilip2615, amin7, swissspidy, audrasjb. Fixes #61317. git-svn-id: https://develop.svn.wordpress.org/trunk@59945 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c7e01a4 commit a68196e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/wp-admin/customize.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@
8484
}
8585
}
8686

87-
$url = ! empty( $_REQUEST['url'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['url'] ) ) : '';
88-
$return = ! empty( $_REQUEST['return'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['return'] ) ) : '';
87+
$url = ! empty( $_REQUEST['url'] ) ? esc_url_raw( wp_unslash( $_REQUEST['url'] ) ) : '';
88+
$return = ! empty( $_REQUEST['return'] ) ? esc_url_raw( wp_unslash( $_REQUEST['return'] ) ) : '';
8989
$autofocus = ! empty( $_REQUEST['autofocus'] ) && is_array( $_REQUEST['autofocus'] )
9090
? array_map( 'sanitize_text_field', wp_unslash( $_REQUEST['autofocus'] ) )
9191
: array();

0 commit comments

Comments
 (0)