From c463e94a3313ca26c305993a0862e758c0ea3dfe Mon Sep 17 00:00:00 2001 From: Peter Wilson Date: Tue, 23 Feb 2021 02:00:06 +0000 Subject: [PATCH] Security: move Content-Security-Policy script loaders. Move `wp_get_script_tag()`, `wp_print_script_tag()`, `wp_print_inline_script_tag()` and `wp_get_inline_script_tag()` functions from `functions.php` to `script-loader.php`. Relocate related tests to `dependencies` sub-directory. Follow up to [50167]. Props adamsilverstein, hellofromTonya, SergeyBiryukov. Fixes #39941. Built from https://develop.svn.wordpress.org/trunk@50409 git-svn-id: http://core.svn.wordpress.org/trunk@50020 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 120 ---------------------------------- wp-includes/script-loader.php | 120 ++++++++++++++++++++++++++++++++++ wp-includes/version.php | 2 +- 3 files changed, 121 insertions(+), 121 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 56f50ce2de..5935f781fb 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -7866,123 +7866,3 @@ function is_php_version_compatible( $required ) { function wp_fuzzy_number_match( $expected, $actual, $precision = 1 ) { return abs( (float) $expected - (float) $actual ) <= $precision; } - -/** - * Sanitizes an attributes array into an attributes string to be placed inside a `\n", wp_sanitize_script_attributes( $attributes ) ); -} - -/** - * Prints formatted `\n", wp_sanitize_script_attributes( $attributes ), $javascript ); -} - -/** - * Prints inline JavaScript wrapped in `\n", wp_sanitize_script_attributes( $attributes ) ); +} + +/** + * Prints formatted `\n", wp_sanitize_script_attributes( $attributes ), $javascript ); +} + +/** + * Prints inline JavaScript wrapped in `