Fix/player-name-validation : Add length validation to Player name field to prevent DB truncation errors#2308
Merged
sydseter merged 5 commits intoOWASP:masterfrom Feb 26, 2026
Conversation
923870c to
61745c9
Compare
Contributor
Author
|
Everything is good from my side, Please take a look at CI checks. Thanks, |
Contributor
Author
|
This is done, Please take a look at : #2307 Thanks, |
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
Potential fix for code scanning alert no. 1: Bad HTML filtering regexp
sydseter
requested changes
Feb 20, 2026
dabbeae to
4d2b860
Compare
Contributor
Author
|
I think I need to update the |
cab30c9 to
cfc5288
Compare
47f0e31 to
269339b
Compare
edea7c4 to
d2a9f8b
Compare
Contributor
Author
|
I think we are done, CI checks are quite challenging 😅, Anyway, all commits are verified, and the changes are applied to the updated code from owasp/master. Thanks, |
sydseter
requested changes
Feb 21, 2026
sydseter
previously approved these changes
Feb 26, 2026
The merge-base changed after approval.
sydseter
approved these changes
Feb 26, 2026
sydseter
approved these changes
Feb 26, 2026
sydseter
approved these changes
Feb 26, 2026
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.
Issue Related : #2307
Summary
This PR adds length validation to the
Playerschema to prevent database-level truncation errors when names exceed the defined column size.Changes Made
Added
validate_length(:name, min: 1, max: 100)toPlayer.changeset/2Ensures input is validated at the application layer before database insertion
Prevents
string_data_right_truncationdatabase errorPrevents LiveView crash and HTTP 500 response
Before
Submitting a name longer than 255 characters resulted in:
PostgreSQL error
22001LiveView crash
500 response
After
Submitting a name exceeding the allowed limit:
Fails validation cleanly
Returns a changeset error
Does not trigger a database exception
No 500 response