diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html
index 0dbf238a3b..93b81b1997 100644
--- a/phpBB/docs/CHANGELOG.html
+++ b/phpBB/docs/CHANGELOG.html
@@ -98,6 +98,7 @@
[Fix] Show error in the ACP when template folder is not readable. (Bug #45705 - Patch by bantu)
[Fix] Adjust viewonline filename regular expression to be less strict. (Bug #46215 - Patch by bantu)
[Fix] Correctly apply the can change vote permission again. Regression intorduced in r9470. (Bug #45895)
+ [Fix] Also remove data from friend/foe table when deleting user. (Bug #45345 - Patch by nickvergessen)
[Change] Change the data format of the default file ACM to be more secure from tampering and have better performance.
[Change] Add index on log_time to the log table to prevent slowdown on boards with many log entries. (Bug #44665 - Patch by bantu)
[Feature] Backported 3.2 captcha plugins.
diff --git a/phpBB/includes/functions_user.php b/phpBB/includes/functions_user.php
index 0345f039a3..48fb532d00 100644
--- a/phpBB/includes/functions_user.php
+++ b/phpBB/includes/functions_user.php
@@ -501,6 +501,12 @@ function user_delete($mode, $user_id, $post_username = false)
$cache->destroy('sql', MODERATOR_CACHE_TABLE);
+ // Delete the user_id from the zebra table
+ $sql = 'DELETE FROM ' . ZEBRA_TABLE . '
+ WHERE user_id = ' . $user_id . '
+ OR zebra_id = ' . $user_id;
+ $db->sql_query($sql);
+
// Delete the user_id from the banlist
$sql = 'DELETE FROM ' . BANLIST_TABLE . '
WHERE ban_userid = ' . $user_id;