From 18f992af83c2c4de2dc5c888df851bed378cdc74 Mon Sep 17 00:00:00 2001 From: cbravobernal Date: Tue, 1 Oct 2024 17:25:14 +0000 Subject: [PATCH] Script Modules: prevent broken links by using includes_url. [59083] introduced an issue where Script Modules registered src does not correctly respect the includes path. Before that change, script modules were registered using includes_url. The patch used a hard-coded path which breaks when sites are not served from the root, e.g. the site root is https://example.com/wp instead of https://example.com/. Follow-up to [59083]. Props nendeb55, jonsurrell, cbravobernal. Fixes #62146. Built from https://develop.svn.wordpress.org/trunk@59154 git-svn-id: http://core.svn.wordpress.org/trunk@58549 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-modules.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-modules.php b/wp-includes/script-modules.php index 80831f1a54..c5cc6cdab7 100644 --- a/wp-includes/script-modules.php +++ b/wp-includes/script-modules.php @@ -169,7 +169,7 @@ function wp_default_script_modules() { break; } - $path = "/wp-includes/js/dist/script-modules/{$file_name}"; + $path = includes_url( "js/dist/script-modules/{$file_name}" ); wp_register_script_module( $script_module_id, $path, $script_module_data['dependencies'], $script_module_data['version'] ); } } diff --git a/wp-includes/version.php b/wp-includes/version.php index a92137f3e7..0c80de4f63 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-beta1-59153'; +$wp_version = '6.7-beta1-59154'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.