Repository navigation
Five for the Future: Pledge form handling updates - #414
Merged
Merged
Conversation
`media_handle_sideload()` fills an attachment's title and content from the image file's own IPTC and EXIF records when the caller passes neither a description nor post overrides, so an uploaded logo decided what its attachment said. The content is stored through the post kses profile, which keeps `data-*` attributes, and the block theme renders it on the attachment's page. Pass the organization's name, pin the content, and discard the free-text metadata the file carries about itself. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The confirmation handler published whatever pledge its token named, and the resend handler issued a fresh token for any unconfirmed pledge, neither of them looking at the state the pledge was in. A pledge an administrator had taken out of view could be put back by following a link. Confine both handlers to pledges that are still live, and drop the outstanding token when a pledge is deactivated so a link already sent stops working. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The join branch accepted any invitation that was not already published, which included ones a sponsor had removed, and it never looked at the pledge the invitation belonged to. Nonces stay valid for hours, so a removed invitee could submit one afterwards and restore the association. Require a pending invitation and a published pledge, and say so plainly when neither holds rather than reporting a join that did not happen. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Three related bits of housekeeping around the pledge form.
Name the pledge logo after the pledge.
media_handle_sideload()was called with neither a description nor post overrides, so core filled the attachment's title and content from the image file's own IPTC and EXIF records. The content is stored through the post kses profile and rendered on the attachment's page by the block theme. The sideload now passes the organization's name, pins the content, and discards the free-text metadata the file carries about itself.Limit email confirmation to pledges awaiting it. The confirmation handler published whatever pledge its token named, and the resend handler issued a fresh token for any unconfirmed pledge, neither looking at the pledge's state. Both are now confined to pledges that are still live, and
deactivate()drops the outstanding token so a link already sent stops working.Accept only pending invitations to live pledges. The join branch accepted any invitation that was not already published — including ones a sponsor had removed — and never checked the parent pledge. It now requires a pending invitation and a published pledge, and says so when neither holds instead of reporting a join that did not happen.
Testing
New coverage in
test-pledge-form.php,test-pledge.phpandtest-contributor.php. Each new test was confirmed to fail against the previous behaviour before the change. Full suite: 43 tests, 186 assertions, green.phpcsoutput for the plugin is unchanged fromproduction.🤖 Generated with Claude Code