WordPress.tv: Fix subtitle upload error on cached/unauthenticated submissions - #820
WordPress.tv: Fix subtitle upload error on cached/unauthenticated submissions#820wprashed wants to merge 3 commits into
Conversation
Prevent unauthenticated subtitle uploads with a valid username from failing due to stale or cached nonces, and send nocache headers on the subtitle upload page. Fixes https://meta.trac.wordpress.org/ticket/8406 Props sebastienserre, wprashed.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review. 📝 WalkthroughWalkthroughThe subtitle upload handler now normalizes nonce input and supports WordPress.org username-based bypasses. The upload page also sends no-cache headers before rendering. ChangesSubtitle upload handling
Estimated code review effort: 2 (Simple) | ~10 minutes Merge Risk: ⚪ Minimal · up to This PR adjusts subtitle submission handling for unauthenticated or stale-nonce requests and prevents the submission form from being cached; no actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Trac ticket: https://meta.trac.wordpress.org/ticket/8406
Description
When submitting subtitles via
/subtitle/?video=..., unauthenticated users or users with stale nonces (due to page caching or browser cache differences such as on Firefox) encounteredInvalid form data. Please go back and try again..This mirrors the handling in
anon-upload.phpby ensuring unauthenticated submissions providing a WordPress.org username are not blocked by stale nonces, and addsnocache_headers()toupload-subtitles-template.phpto prevent caching of the subtitle submission form.Props
Props @sebastienserre, @wprashed.
Summary by CodeRabbit