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

git-svn-id: https://develop.svn.wordpress.org/trunk@22083 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dion Hulse 2012-09-29 01:33:15 +00:00
parent 693fccb99c
commit 6312ae8e06
1 changed files with 5 additions and 5 deletions

View File

@ -307,14 +307,14 @@ class WP_Filesystem_Base {
if ($key = array_search($attarray[$i], $legal))
$realmode .= $legal[$key];
$mode = str_pad($realmode, 9, '-');
$mode = str_pad($realmode, 10, '-', STR_PAD_LEFT);
$trans = array('-'=>'0', 'r'=>'4', 'w'=>'2', 'x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '';
$newmode .= $mode[0] + $mode[1] + $mode[2];
$newmode .= $mode[3] + $mode[4] + $mode[5];
$newmode .= $mode[6] + $mode[7] + $mode[8];
$newmode = $mode[0];
$newmode .= $mode[1] + $mode[2] + $mode[3];
$newmode .= $mode[4] + $mode[5] + $mode[6];
$newmode .= $mode[7] + $mode[8] + $mode[9];
return $newmode;
}