From: Tomas V.V.Cox Date: Wed, 23 Jan 2002 18:53:08 +0000 (+0000) Subject: Return false when the directory can not be created in mkDir() X-Git-Tag: PRE_ISSET_PATCH~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=62c923452080a17c25d87cc995b28e69f5deb3bf;p=php Return false when the directory can not be created in mkDir() --- diff --git a/pear/System.php b/pear/System.php index 939692b8a7..fd90901295 100644 --- a/pear/System.php +++ b/pear/System.php @@ -197,6 +197,7 @@ class System extends PEAR $mode = $opt[1]; } } + $ret = true; if (isset($create_parents)) { foreach($opts[1] as $dir) { $dirstack = array(); @@ -206,18 +207,18 @@ class System extends PEAR } while ($newdir = array_shift($dirstack)) { if (!mkdir($newdir, $mode)) { - break; // XXX error + $ret = false; } } } } else { foreach($opts[1] as $dir) { - if (!mkdir($dir, $mode)) { - continue; // XXX error + if (!@is_dir($dir) && !mkdir($dir, $mode)) { + $ret = false; } } } - return true; + return $ret; } /**