Skip to content

Remove leading/trailing whitespace from credit parts#1572

Merged
cpeel merged 1 commit intoDistributedProofreaders:masterfrom
cpeel:trim-credit-components
Apr 2, 2026
Merged

Remove leading/trailing whitespace from credit parts#1572
cpeel merged 1 commit intoDistributedProofreaders:masterfrom
cpeel:trim-credit-components

Conversation

@cpeel
Copy link
Copy Markdown
Member

@cpeel cpeel commented Apr 1, 2026

Ensure that all components used to build the credits field do not have leading or trailing whitespace. This could come from a user's real name field or "other" value, scanner credit, or extra credit.

Note we don't have to do this for usernames as leading and trailing whitespace characters are not valid in usernames.

Fixes #1570

Sandbox: https://www.pgdp.org/~cpeel/c.branch/trim-credit-components/

Ensure that all components used to build the credits field do not
have leading or trailing whitespace. This could come from a user's
real name field or "other" value, scanner credit, or extra credit.
@cpeel cpeel self-assigned this Apr 1, 2026
Copy link
Copy Markdown
Member

@srjfoo srjfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😁 -- this was challenging to test. What I wound up having to do ultimately was register a new TEST user with spaces trailing the real_name field. Updating your profile, you can't add trailing spaces to the real name, though you can to the credit name.

What turned out to be the challenge was that, as far as I could tell, the credit name field was already being trimmed. And the PPer field was already being trimmed. What wasn't being trimmed was the PM field.

To save others the trouble, compare the main test server with the sandbox

Copy link
Copy Markdown
Collaborator

@windymilla windymilla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks - that looks great!

@cpeel cpeel merged commit 15a1fdc into DistributedProofreaders:master Apr 2, 2026
9 checks passed
@cpeel cpeel deleted the trim-credit-components branch April 2, 2026 16:48
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

Successfully merging this pull request may close these issues.

Unwanted space character in Credit line

4 participants