summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/account/delete.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/public/account/delete.php b/public/account/delete.php
index 4459edb..99aebe5 100644
--- a/public/account/delete.php
+++ b/public/account/delete.php
@@ -22,8 +22,15 @@ setcookie("secret_key", "", time() - 1000);
$db = null;
$path = "../static/userdata/avatars/$id";
-if (is_file($path)) {
- unlink($path);
+if (is_dir($path)) {
+ array_map("unlink", glob("$path/*.*"));
+ rmdir($path);
+}
+
+$path = "../static/userdata/banners/$id";
+if (is_dir($path)) {
+ array_map("unlink", glob("$path/*.*"));
+ rmdir($path);
}
header("Location: /account"); \ No newline at end of file