General: Replace all esc_url_raw() calls in core with sanitize_url().
This aims to improve performance by calling `sanitize_url()` directly, instead of the `esc_url_raw()` wrapper. As of WordPress 6.1, `sanitize_url()` is the recommended function for sanitizing a URL for database or redirect usage. Follow-up to [11383], [13096], [51597], [53452]. Props benjgrolleau, peterwilsoncc, SergeyBiryukov. Fixes #55852. Built from https://develop.svn.wordpress.org/trunk@53455 git-svn-id: http://core.svn.wordpress.org/trunk@53044 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -90,7 +90,7 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
|
||||
$old_home_parsed = parse_url( $old_home_url );
|
||||
|
||||
if ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
|
||||
$new_home_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
|
||||
$new_home_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
|
||||
update_option( 'home', $new_home_url );
|
||||
}
|
||||
|
||||
@@ -98,7 +98,7 @@ if ( isset( $_REQUEST['action'] ) && 'update-site' === $_REQUEST['action'] ) {
|
||||
$old_site_parsed = parse_url( $old_site_url );
|
||||
|
||||
if ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
|
||||
$new_site_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
|
||||
$new_site_url = untrailingslashit( sanitize_url( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
|
||||
update_option( 'siteurl', $new_site_url );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user