WP Filesystem: Correctly parse the permissions field in the directory listings, and actually set it in FTP environments

Props mnelson4 for initial patch.
Fixes #29548


git-svn-id: https://develop.svn.wordpress.org/trunk@32923 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse
2015-06-24 04:48:18 +00:00
parent bdace7c8b5
commit fc52d9cbb1
3 changed files with 17 additions and 2 deletions
@@ -310,7 +310,7 @@ class WP_Filesystem_Base {
* @return string The *nix-style representation of permissions.
*/
public function gethchmod( $file ){
$perms = $this->getchmod($file);
$perms = intval( $this->getchmod( $file ), 8 );
if (($perms & 0xC000) == 0xC000) // Socket
$info = 's';
elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
@@ -351,6 +351,17 @@ class WP_Filesystem_Base {
return $info;
}
/**
* Gets the permissions of the specified file or filepath in their octal format
*
* @since 4.0
* @param string $file
* @return string the last 3 characters of the octal number
*/
public function getchmod( $file ) {
return '777';
}
/**
* Convert *nix-style file permissions to a octal number.
*