mirror of
git://develop.git.wordpress.org/
synced 2025-04-21 20:51:55 +02:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@58684 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
55e0fafbbf
commit
e3e7fdbf7c
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -160,7 +160,7 @@ abstract class WP_Filesystem_Direct_UnitTestCase extends WP_UnitTestCase {
|
||||
* @return bool Whether the operating system is Windows.
|
||||
*/
|
||||
public static function is_windows() {
|
||||
return 'WIN' === substr( PHP_OS, 0, 3 );
|
||||
return 'Windows' === PHP_OS_FAMILY;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user