mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user