mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 17:48:01 +01:00
Filesystem: Fix getchmod() for direct and ssh2 transports, for directories.
props DavidAnderson. fixes #26598. Built from https://develop.svn.wordpress.org/trunk@27566 git-svn-id: http://core.svn.wordpress.org/trunk@27409 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bba24b09ca
commit
3c3e9a530b
@ -194,10 +194,10 @@ class WP_Filesystem_Direct extends WP_Filesystem_Base {
|
|||||||
* FIXME does not handle errors in fileperms()
|
* FIXME does not handle errors in fileperms()
|
||||||
*
|
*
|
||||||
* @param string $file Path to the file.
|
* @param string $file Path to the file.
|
||||||
* @return string Mode of the file (last 4 digits).
|
* @return string Mode of the file (last 3 digits).
|
||||||
*/
|
*/
|
||||||
function getchmod($file) {
|
function getchmod($file) {
|
||||||
return substr(decoct(@fileperms($file)),3);
|
return substr( decoct( @fileperms( $file ) ), -3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
function group($file) {
|
function group($file) {
|
||||||
|
@ -230,7 +230,7 @@ class WP_Filesystem_SSH2 extends WP_Filesystem_Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getchmod($file) {
|
function getchmod($file) {
|
||||||
return substr(decoct(@fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/') )),3);
|
return substr( decoct( @fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim( $file, '/' ) ) ), -3 );
|
||||||
}
|
}
|
||||||
|
|
||||||
function group($file) {
|
function group($file) {
|
||||||
|
Loading…
Reference in New Issue
Block a user