From 034cb1e777a325bfea82c656c5c8df15c18c787a Mon Sep 17 00:00:00 2001
From: Michael Nelson <michael@eventespresso.com>
Date: Fri, 5 Sep 2014 14:27:24 -0700
Subject: [PATCH] added WP_Filesystem_Base::getchmod(), and in
WP_Filesystem_Base::gethchmod() converts its return value
to an octal int
---
src/wp-admin/includes/class-wp-filesystem-base.php | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/wp-admin/includes/class-wp-filesystem-base.php b/src/wp-admin/includes/class-wp-filesystem-base.php
index 4630f71..fbc83ac 100644
a
|
b
|
class WP_Filesystem_Base { |
361 | 361 | * @return string The *nix-style representation of permissions. |
362 | 362 | */ |
363 | 363 | public function gethchmod( $file ){ |
364 | | $perms = $this->getchmod($file); |
| 364 | $perms = intval( $this->getchmod($file), 8 ); |
365 | 365 | if (($perms & 0xC000) == 0xC000) // Socket |
366 | 366 | $info = 's'; |
367 | 367 | elseif (($perms & 0xA000) == 0xA000) // Symbolic Link |
… |
… |
class WP_Filesystem_Base { |
403 | 403 | } |
404 | 404 | |
405 | 405 | /** |
| 406 | * Gets the permissions of the specified file or filepath in their octal format |
| 407 | * @since 4.0 |
| 408 | * @param string $file |
| 409 | * @return string the last 3 characters of the octal number |
| 410 | */ |
| 411 | public function getchmod( $file ){ |
| 412 | return '777'; |
| 413 | } |
| 414 | /** |
406 | 415 | * Convert *nix-style file permissions to a octal number. |
407 | 416 | * |
408 | 417 | * Converts '-rw-r--r--' to 0644 |