From 74f8c0bbfa5c45d472dd07d36ea985c32fa01c45 Mon Sep 17 00:00:00 2001 From: triath Date: Wed, 19 Aug 2015 17:28:58 +0200 Subject: [PATCH 1/2] Fix bug in deleting characters from myaccount.php The bug was that if you had multiple characters pending for deletion for different dates this query would set all pending characters as done even if they weren't deleted and they would therefore be prevented from being deleted or cancelled. --- myaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myaccount.php b/myaccount.php index 79455f8..cd0d9af 100644 --- a/myaccount.php +++ b/myaccount.php @@ -229,7 +229,7 @@ if ($render_page) { echo 'CAUTION! Your character with name ' . $delete['character_name'] . ' will be deleted on ' . $delete['time'] . '. Cancel this operation.
'; else { user_delete_character(user_character_id($delete['character_name'])); - mysql_update('UPDATE `znote_deleted_characters` SET `done` = 1'); + mysql_update('UPDATE `znote_deleted_characters` SET `done` = 1 WHERE `character_name` = \''. $delete['character_name']. '\''); echo 'Character ' . $delete['character_name'] . ' has been deleted. This operation was requested by owner of this account.'; $char_count--; } From e37ab046bd037cf90eaae457377ab4594cc254f6 Mon Sep 17 00:00:00 2001 From: triath Date: Wed, 19 Aug 2015 18:19:31 +0200 Subject: [PATCH 2/2] Use id in query instead of character_name --- myaccount.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/myaccount.php b/myaccount.php index cd0d9af..a97c2ae 100644 --- a/myaccount.php +++ b/myaccount.php @@ -229,7 +229,7 @@ if ($render_page) { echo 'CAUTION! Your character with name ' . $delete['character_name'] . ' will be deleted on ' . $delete['time'] . '. Cancel this operation.
'; else { user_delete_character(user_character_id($delete['character_name'])); - mysql_update('UPDATE `znote_deleted_characters` SET `done` = 1 WHERE `character_name` = \''. $delete['character_name']. '\''); + mysql_update('UPDATE `znote_deleted_characters` SET `done` = 1 WHERE `id` = '. $delete['id']. ''); echo 'Character ' . $delete['character_name'] . ' has been deleted. This operation was requested by owner of this account.'; $char_count--; }