Commit e0d23b9e authored by Steven Jones's avatar Steven Jones

Issue #1873384 by Steven Jones: Fixed 'Silence warning' commit broke 6.x-2.x.

parent 609772d9
......@@ -207,14 +207,16 @@ function _provision_recursive_delete($path) {
// is_dir() follows symlinks, so it can return true on a symlink
if (is_dir($path) && !is_link($path)) {
$d = dir($path);
while (($entry = $d->read()) !== FALSE) {
if ($entry == '.' || $entry == '..') {
continue;
if (!empty($d)) {
while (($entry = $d->read()) !== FALSE) {
if ($entry == '.' || $entry == '..') {
continue;
}
$entry_path = $path . '/' . $entry;
$ret &= _provision_recursive_delete($entry_path);
}
$entry_path = $path . '/' . $entry;
$ret &= _provision_recursive_delete($entry_path);
$d->close();
}
$d->close();
$rm = provision_file()->rmdir($path)
->succeed('Deleting @path directory successful.')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment