Make WordPress Core

Ticket #26598: getchmod.diff

File getchmod.diff, 1.1 KB (added by DavidAnderson, 13 years ago)

Patch (replacing previous version)

  • trunk/wp-admin/includes/class-wp-filesystem-direct.php

     
    197197         * @return string Mode of the file (last 4 digits).
    198198         */
    199199        function getchmod($file) {
    200                 return substr(decoct(@fileperms($file)),3);
     200                return substr(sprintf("%06d", decoct(@fileperms($file))),3);
    201201        }
    202202
    203203        function group($file) {
  • trunk/wp-admin/includes/class-wp-filesystem-ssh2.php

     
    230230        }
    231231
    232232        function getchmod($file) {
    233                 return substr(decoct(@fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/') )),3);
     233                return substr(sprintf("%06d", decoct(@fileperms( 'ssh2.sftp://' . $this->sftp_link . '/' . ltrim($file, '/') ))),3);
    234234        }
    235235
    236236        function group($file) {