Update UserController.php
This commit is contained in:
parent
0d4caa7110
commit
434e6bbd7a
|
@ -748,17 +748,12 @@ class UserController extends Controller
|
||||||
$files = scandir($folder);
|
$files = scandir($folder);
|
||||||
|
|
||||||
foreach ($files as $file) {
|
foreach ($files as $file) {
|
||||||
if ($file !== '.' && $file !== '..') {
|
$basename = basename($file);
|
||||||
if (preg_match($regex, $file)) {
|
if (preg_match($regex, $basename)) {
|
||||||
$new_file = preg_replace($regex, '', $file);
|
$newBasename = preg_replace($regex, '', $basename);
|
||||||
File::copyDirectory($folder . '/' . $file, $folder . '/' . $new_file);
|
$newPath = $folder . '/' . $newBasename;
|
||||||
$dirname = $folder . '/' . $file;
|
File::copyDirectory($file, $newPath);
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
File::deleteDirectory($file);
|
||||||
system('rmdir ' . escapeshellarg($dirname) . ' /s /q');
|
|
||||||
} else {
|
|
||||||
system("rm -rf " . escapeshellarg($dirname));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue