From 5400c50367ed2a5fc9d16e90b84cbabd94890072 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Tue, 3 Aug 2021 12:04:58 +0000 Subject: [PATCH] Code Modernization: Pass correct default value to `new DateTime()` in `wp_default_packages_inline_scripts()`. This fixes a "Deprecated: `DateTime::__construct()`: Passing null to parameter #1 (`$datetime`) of type string is deprecated" warning on PHP 8.1. Follow-up to [49083]. See #53635. Built from https://develop.svn.wordpress.org/trunk@51533 git-svn-id: http://core.svn.wordpress.org/trunk@51144 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/script-loader.php | 2 +- wp-includes/version.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/script-loader.php b/wp-includes/script-loader.php index d0caecabc7..e4ec2088f0 100644 --- a/wp-includes/script-loader.php +++ b/wp-includes/script-loader.php @@ -330,7 +330,7 @@ function wp_default_packages_inline_scripts( $scripts ) { $timezone_abbr = ''; if ( ! empty( $timezone_string ) ) { - $timezone_date = new DateTime( null, new DateTimeZone( $timezone_string ) ); + $timezone_date = new DateTime( 'now', new DateTimeZone( $timezone_string ) ); $timezone_abbr = $timezone_date->format( 'T' ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index aa9217cc06..dd3b0d12d5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.9-alpha-51532'; +$wp_version = '5.9-alpha-51533'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.