From: Greg Beaver Date: Mon, 19 Jan 2004 03:32:12 +0000 (+0000) Subject: fix -m argument to mkDir(). Conversion to octal was not being made, X-Git-Tag: php_ibase_before_split~109 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b0494146b6f83b3da6e0cd0d6509cb1f6aca2254;p=php fix -m argument to mkDir(). Conversion to octal was not being made, and a string should never be passed into mkdir(). Thanks to Alex Hayes --- diff --git a/pear/System.php b/pear/System.php index de49de5c99..1d5cd55aed 100644 --- a/pear/System.php +++ b/pear/System.php @@ -226,6 +226,14 @@ class System if ($opt[0] == 'p') { $create_parents = true; } elseif($opt[0] == 'm') { + // if the mode is clearly an octal number (starts with 0) + // convert it to decimal + if (strlen($opt[1]) && $opt[1]{0} == '0') { + $opt[1] = octdec($opt[1]); + } else { + // convert to int + $opt[1] += 0; + } $mode = $opt[1]; } }