wp/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php
changeset 21 48c4eec2b7e6
parent 19 3d72ae0968f4
--- a/wp/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php	Thu Sep 29 08:06:27 2022 +0200
+++ b/wp/wp-includes/customize/class-wp-customize-nav-menu-item-setting.php	Fri Sep 05 18:40:08 2025 +0200
@@ -183,7 +183,6 @@
 				throw new Exception( "Supplied nav_menu_item value missing property: $missing" );
 			}
 		}
-
 	}
 
 	/**
@@ -228,7 +227,7 @@
 		} else {
 			$value = false;
 
-			// Note that a ID of less than one indicates a nav_menu not yet inserted.
+			// Note that an ID of less than one indicates a nav_menu not yet inserted.
 			if ( $this->post_id > 0 ) {
 				$post = get_post( $this->post_id );
 				if ( $post && self::POST_TYPE === $post->post_type ) {
@@ -726,7 +725,7 @@
 		$menu_item_value['description'] = wp_unslash( apply_filters( 'content_save_pre', wp_slash( $menu_item_value['description'] ) ) );
 
 		if ( '' !== $menu_item_value['url'] ) {
-			$menu_item_value['url'] = esc_url_raw( $menu_item_value['url'] );
+			$menu_item_value['url'] = sanitize_url( $menu_item_value['url'] );
 			if ( '' === $menu_item_value['url'] ) {
 				return new WP_Error( 'invalid_url', __( 'Invalid URL.' ) ); // Fail sanitization if URL is invalid.
 			}
@@ -878,7 +877,6 @@
 				}
 			}
 		}
-
 	}
 
 	/**