diff --git a/wp-admin/includes/class-wp-filesystem-direct.php b/wp-admin/includes/class-wp-filesystem-direct.php index 2efd5b000a..ed22a821a1 100644 --- a/wp-admin/includes/class-wp-filesystem-direct.php +++ b/wp-admin/includes/class-wp-filesystem-direct.php @@ -249,15 +249,18 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base { /** * Gets the permissions of the specified file or filepath in their octal format. * - * FIXME does not handle errors in fileperms() - * * @since 2.5.0 * * @param string $file Path to the file. - * @return string Mode of the file (the last 3 digits). + * @return string Mode of the file (the last 3 digits), or the string "0" on failure. */ public function getchmod( $file ) { - return substr( decoct( @fileperms( $file ) ), -3 ); + $perms = @fileperms( $file ); + if ( false === $perms ) { + return '0'; + } + + return substr( decoct( $perms ), -3 ); } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index 33ef7eaabc..056fa2c7e6 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '7.0-alpha-61397'; +$wp_version = '7.0-alpha-61398'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.