Repository navigation
Conversation
ban\manager::unban() logged [$unbanned_users], an array, where ban() logs a joined string, so showing the admin or moderator log gave an "Array to string conversion" warning, and email and IP unbans named nothing. Log the unbanned usernames, or the email addresses or IPs, as one string, like ban() does. The user-notes loop also took the usernames from after_unban() as user ids; loop over its keys instead. Add a test for all three ban types. PHPBB-17753
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Checklist:
Tracker ticket:
https://tracker.phpbb.com/browse/PHPBB-17753
\phpbb\ban\manager::unban()logged[$unbanned_users], an array, whereban()logs a joined string. Showing the admin or moderator log then gaveArray to string conversioninlanguage::lang_array(), and email and IP unbans named nothing, becauseafter_unban()returns an empty array for those types. This logs the unbanned usernames, or the email addresses or IPs, as one string, the wayban()does.The user-notes loop also used the values of
after_unban()(usernames) as user ids, so unbanned users never got their note. It now loops over the keys.The new
test_unban_logsintests/ban/ban_manager_test.phpcovers user, email and IP unbans. Run locally in Docker with SQLite, it fails on current master and passes with this change; the rest of the ban manager tests, the session ban check and the email validation tests also pass.Log rows already written with an array still warn when shown. This PR leaves them alone; a migration could rewrite them if wanted.
Investigated and written by Claude on behalf of William Jacoby (bonelifer).