From 556c6d80d81afadc377f7382e8344b79b1f71da6 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 25 Feb 2020 00:59:06 +0000 Subject: [PATCH] Script Loader: Remove unnecessary reference sign from function definitions in script loader. This resolves PHP warnings when extensions like `php_uopz` or `php_tideways_xhprof` are in use. Object variables in PHP 5+ contain a reference to the object, and it's the reference that's passed around. Props jqz, killerbishop, Mte90, TJNowell, jorbin, pento, pcarvalho, valentinbora, SergeyBiryukov. Fixes #44979. Built from https://develop.svn.wordpress.org/trunk@47355 git-svn-id: http://core.svn.wordpress.org/trunk@47142 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 16 ++++++++-------- wp-includes/version.php | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index 634153ba99..f354b9edf0 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -41,7 +41,7 @@ require ABSPATH . WPINC . '/functions.wp-styles.php'; * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) { +function wp_register_tinymce_scripts( $scripts, $force_uncompressed = false ) { global $tinymce_version, $concatenate_scripts, $compress_scripts; $suffix = wp_scripts_get_suffix(); $dev_suffix = wp_scripts_get_suffix( 'dev' ); @@ -73,7 +73,7 @@ function wp_register_tinymce_scripts( &$scripts, $force_uncompressed = false ) { * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_default_packages_vendor( &$scripts ) { +function wp_default_packages_vendor( $scripts ) { global $wp_locale; $suffix = wp_scripts_get_suffix(); @@ -176,7 +176,7 @@ function wp_default_packages_vendor( &$scripts ) { * @param array $tests Features to detect. * @return string Conditional polyfill inline script. */ -function wp_get_script_polyfill( &$scripts, $tests ) { +function wp_get_script_polyfill( $scripts, $tests ) { $polyfill = ''; foreach ( $tests as $test => $handle ) { if ( ! array_key_exists( $handle, $scripts->registered ) ) { @@ -228,7 +228,7 @@ function wp_get_script_polyfill( &$scripts, $tests ) { * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_default_packages_scripts( &$scripts ) { +function wp_default_packages_scripts( $scripts ) { $suffix = wp_scripts_get_suffix(); // Expects multidimensional array like: @@ -273,7 +273,7 @@ function wp_default_packages_scripts( &$scripts ) { * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_default_packages_inline_scripts( &$scripts ) { +function wp_default_packages_inline_scripts( $scripts ) { global $wp_locale; if ( isset( $scripts->registered['wp-api-fetch'] ) ) { @@ -521,7 +521,7 @@ function wp_tinymce_inline_scripts() { * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_default_packages( &$scripts ) { +function wp_default_packages( $scripts ) { wp_default_packages_vendor( $scripts ); wp_register_tinymce_scripts( $scripts ); wp_default_packages_scripts( $scripts ); @@ -580,7 +580,7 @@ function wp_scripts_get_suffix( $type = '' ) { * * @param WP_Scripts $scripts WP_Scripts object. */ -function wp_default_scripts( &$scripts ) { +function wp_default_scripts( $scripts ) { $suffix = wp_scripts_get_suffix(); $dev_suffix = wp_scripts_get_suffix( 'dev' ); $guessurl = site_url(); @@ -1615,7 +1615,7 @@ function wp_default_scripts( &$scripts ) { * * @param WP_Styles $styles */ -function wp_default_styles( &$styles ) { +function wp_default_styles( $styles ) { // Include an unmodified $wp_version. require ABSPATH . WPINC . '/version.php'; diff --git a/wp-includes/version.php b/wp-includes/version.php index 6d6d392c0d..35a03e009a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.4-beta2-47354'; +$wp_version = '5.4-beta2-47355'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.