Make WordPress Core

Ticket #29548: 0001-added-WP_Filesystem_Base-getchmod-and-in-WP_Filesyst.patch

File 0001-added-WP_Filesystem_Base-getchmod-and-in-WP_Filesyst.patch, 1.4 KB (added by mnelson4, 11 years ago)

git patch to apply to master

  • src/wp-admin/includes/class-wp-filesystem-base.php

    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 { 
    361361         * @return string The *nix-style representation of permissions.
    362362         */
    363363        public function gethchmod( $file ){
    364                 $perms = $this->getchmod($file);
     364                $perms = intval( $this->getchmod($file), 8 );
    365365                if (($perms & 0xC000) == 0xC000) // Socket
    366366                        $info = 's';
    367367                elseif (($perms & 0xA000) == 0xA000) // Symbolic Link
    class WP_Filesystem_Base { 
    403403        }
    404404
    405405        /**
     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        /**
    406415         * Convert *nix-style file permissions to a octal number.
    407416         *
    408417         * Converts '-rw-r--r--' to 0644