From 61c8c315a932334eec4186fa6eeecca06fcc4273 Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sun, 7 Jul 2024 12:44:16 +0000 Subject: [PATCH] Code Modernization: Replace `substr( PHP_OS, 0, 3 )` calls with `PHP_OS_FAMILY`. The `PHP_OS_FAMILY` constant indicates the operating system family PHP was built for, and is available as of PHP 7.2.0. Reference: [https://www.php.net/manual/en/reserved.constants.php#constant.php-os-family PHP Manual: Predefined Constants: PHP_OS_FAMILY]. Follow-up to [23255], [57753], [57985], [58678]. Props ayeshrajans, jrf. See #61574. Built from https://develop.svn.wordpress.org/trunk@58684 git-svn-id: http://core.svn.wordpress.org/trunk@58086 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/functions.php | 6 +++--- wp-includes/version.php | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wp-includes/functions.php b/wp-includes/functions.php index ed41eed8c7..c2fe1228bf 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2257,11 +2257,11 @@ function get_temp_dir() { * @return bool Whether the path is writable. */ function wp_is_writable( $path ) { - if ( 'WIN' === strtoupper( substr( PHP_OS, 0, 3 ) ) ) { + if ( 'Windows' === PHP_OS_FAMILY ) { return win_is_writable( $path ); - } else { - return @is_writable( $path ); } + + return @is_writable( $path ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 4bcce31037..62ecf5f741 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58683'; +$wp_version = '6.7-alpha-58684'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.