WordPress.org

Make WordPress Core

Changeset 22083


Ignore:
Timestamp:
09/29/2012 01:33:15 AM (6 years ago)
Author:
dd32
Message:

Make WP_Filesystem_Base::getnumchmodfromh() return the expected values when the executable bit is set in the input. Props Keruspe. Fixes #20365

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/class-wp-filesystem-base.php

    r21222 r22083  
    308308               $realmode .= $legal[$key];
    309309
    310         $mode = str_pad($realmode, 9, '-');
     310        $mode = str_pad($realmode, 10, '-', STR_PAD_LEFT);
    311311        $trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
    312312        $mode = strtr($mode,$trans);
    313313
    314         $newmode = '';
    315         $newmode .= $mode[0] + $mode[1] + $mode[2];
    316         $newmode .= $mode[3] + $mode[4] + $mode[5];
    317         $newmode .= $mode[6] + $mode[7] + $mode[8];
     314        $newmode = $mode[0];
     315        $newmode .= $mode[1] + $mode[2] + $mode[3];
     316        $newmode .= $mode[4] + $mode[5] + $mode[6];
     317        $newmode .= $mode[7] + $mode[8] + $mode[9];
    318318        return $newmode;
    319319    }
Note: See TracChangeset for help on using the changeset viewer.