From 298b6b269f3d2f3369fd96a80b4f174d2c91830e Mon Sep 17 00:00:00 2001 From: Dion Hulse Date: Sat, 29 Sep 2012 01:33:15 +0000 Subject: [PATCH] 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 --- wp-admin/includes/class-wp-filesystem-base.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/wp-admin/includes/class-wp-filesystem-base.php b/wp-admin/includes/class-wp-filesystem-base.php index 0b12855b0e..75808df8a3 100644 --- a/wp-admin/includes/class-wp-filesystem-base.php +++ b/wp-admin/includes/class-wp-filesystem-base.php @@ -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; }