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: http://core.svn.wordpress.org/trunk@22083 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Dion Hulse 2012-09-29 01:33:15 +00:00
parent 19c7ca7729
commit 298b6b269f
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;
}