Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/wp-includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 ( PHP_OS_FAMILY === 'Windows' ) {
return win_is_writable( $path );
} else {
return @is_writable( $path );
}

return @is_writable( $path );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion tests/phpunit/tests/filesystem/wpFilesystemDirect/base.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function create_file_if_needed( $path, $contents = '' ) {
* @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;
}

/**
Expand Down