Repository navigation
Skip failed-login logging when the result has no user_row - #74
Merged
iMattPro merged 1 commit intoNov 10, 2026
Merged
Conversation
login_box() builds a result with only status and error_msg when the login form key check fails. With "Log failed login attempts" enabled, log_failed_login_attempts() then read $event['result']['user_row'] and raised undefined array key warnings on PHP 8. Check isset() first, as the master branch already does, and add a regression test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Author
|
Claude tested this on a phpBB 3.3 board (SQLite, PHP 8.4) with "Log failed login attempts" turned on and the Administrators group watched. Each test posted a login form for 3.3.x without this PR, invalid form token
With this PR
Investigated and written by Claude on behalf of William Jacoby (bonelifer). |
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.
On the 3.3.x branch,
log_failed_login_attempts()reads$event['result']['user_row']['user_id']without checking thatuser_rowexists.login_box()leaves it out when the login form key check fails:With "Log failed login attempts" turned on, submitting an expired login form then raises
Undefined array key "user_row"andTrying to access array offset on value of type nullwarnings on PHP 8, atevent/listener.phpline 188.The master branch already has the
isset()check. This PR backports it to 3.3.x and adds a regression test that dispatchescore.login_box_failedwith a result that has nouser_row.Claude tested it locally with phpBB 3.3.x and PHP 8.4:
failed_logins_testpasses, including the new case.delete_log_security_testandlogin_notification_test. They come fromvsprintf()receiving an array in the language mocks, which is unrelated to this change.php -lpasses on PHP 7.4 and 8.4.🤖 Generated with Claude Code
Investigated and written by Claude on behalf of William Jacoby (bonelifer).