diff --git a/src/wp-admin/includes/class-wp-filesystem-direct.php b/src/wp-admin/includes/class-wp-filesystem-direct.php index 7551e3d273..17ccad8d5d 100644 --- a/src/wp-admin/includes/class-wp-filesystem-direct.php +++ b/src/wp-admin/includes/class-wp-filesystem-direct.php @@ -223,6 +223,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return $owneruid; } $ownerarray = posix_getpwuid( $owneruid ); + if ( ! $ownerarray ) { + return false; + } return $ownerarray['name']; } @@ -257,6 +260,9 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { return $gid; } $grouparray = posix_getgrgid( $gid ); + if ( ! $grouparray ) { + return false; + } return $grouparray['name']; } diff --git a/src/wp-admin/includes/class-wp-filesystem-ssh2.php b/src/wp-admin/includes/class-wp-filesystem-ssh2.php index c099259e1f..94853a650b 100644 --- a/src/wp-admin/includes/class-wp-filesystem-ssh2.php +++ b/src/wp-admin/includes/class-wp-filesystem-ssh2.php @@ -402,6 +402,9 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { return $owneruid; } $ownerarray = posix_getpwuid( $owneruid ); + if ( ! $ownerarray ) { + return false; + } return $ownerarray['name']; } @@ -434,6 +437,9 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base { return $gid; } $grouparray = posix_getgrgid( $gid ); + if ( ! $grouparray ) { + return false; + } return $grouparray['name']; }