Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: character count broken in "Bio/Notes" section #107

Open
DeflateAwning opened this issue Dec 23, 2022 · 0 comments
Open

Bug: character count broken in "Bio/Notes" section #107

DeflateAwning opened this issue Dec 23, 2022 · 0 comments

Comments

@DeflateAwning
Copy link
Contributor

DeflateAwning commented Dec 23, 2022

Reproduction

  1. Login to Spaceport.
  2. Go to Member > Account.
  3. Type to follow (or maybe paste) into the Bio / Notes section:
'aaaaaaaaaa aa aaaaa aaaaaaaaa aaaaaaaaaaa. aaaaaaaaaaaaa aaaa-aaaaaaaa aaaaaaa aaaaaaaa.  aaaaa aaaaaaaaaa aaaaaaaa (aaaaa aaa aaaa).  aaaaaaaaaa aa aaaaaaaaa aaaaaaa, aaaaaaaaaaaaa, aaaaaaaaaaa, aaaaaaaaa aaaaaaaaaaa, aaa aaaaaa, aaaaa (aaaa), aaa (aaaaaaaa, aaaaaa aaa), aaa aaa (aaaaaa, aaaaa, aaaaaa, aa), aaaa aaaaaaa, aaa/aaaaaa aaaaa/aaaaaa, aaaaaaaaaaaa aaaaaaa, aaaaa/aaaa, aaaaaaaa, aa aaaaaaa, aaaaaa, aaaaaaaaaa, aaaaaaaaaaa, aaaaaaaa aaa.  aaaaaa aaaaaaaa aa aaaaaaaaaa/aaaaaaaa aaaaaaaaaaa.
  1. See that the character count is only 507.
  2. Submit.
  3. Expect "512 chars exceeded" error.
  4. Scream about how your repro didn't fail again.

Proposed Problem

On Windows, browsers use a CR+LF line ending. JS doesn't count NL's as 2 bytes, but the server-side error check does. It looks like I have under 512 chars client-side, but the server errors because it counts LF's as chars.

Solution

On submit, server-side (and maybe client-side too) replace LF with null string.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant