summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-05-12 14:12:05 +0500
committerilotterytea <iltsu@alright.party>2025-05-12 14:12:05 +0500
commit437c0482c62794231e713628bb36a54f665a053e (patch)
treebfc59c4f94eca8babf450d5e42288c44bfe602d1 /public
parent6e5481c5d6cc3cc562cc3674b95dacbcb88372d7 (diff)
fix: delete avatars and banners on /delete request
Diffstat (limited to 'public')
-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