mirror of
https://github.com/icecoder/ICEcoder.git
synced 2026-03-09 18:16:48 +01:00
Inform user they can't delete the root
Stops the root accidentally being deleted
This commit is contained in:
@@ -256,7 +256,10 @@ if ($_GET['action']=="delete") {
|
||||
$fullPath = str_replace($docRoot,"",$filesArray[$i]);
|
||||
$fullPath = str_replace($iceRoot,"",$fullPath);
|
||||
$fullPath = $docRoot.$iceRoot.$fullPath;
|
||||
if (!$demoMode && is_writable($fullPath)) {
|
||||
|
||||
if (rtrim($fullPath,"/") == rtrim($docRoot,"/")) {
|
||||
echo "top.ICEcoder.message('Sorry can\\'t delete the root level');";
|
||||
} else if (!$demoMode && is_writable($fullPath)) {
|
||||
is_dir($fullPath)
|
||||
? rrmdir($fullPath)
|
||||
: unlink($fullPath);
|
||||
|
||||
Reference in New Issue
Block a user