Skip to content

Conversation

@sjinks
Copy link
Contributor

@sjinks sjinks commented Feb 9, 2026

What?

This PR ensures that code execution stops after calling wp_safe_redirect() in the two-factor authentication validation functions. Without exit(), PHP continues executing code after sending redirect headers, which could lead to security vulnerabilities or unintended behavior.

Why?

This follows WordPress best practices and aligns with the existing function documentation that states "wp_safe_redirect() does not exit automatically, and should almost always be followed by a call to exit;."

How?

Add exit() after calls to wp_safe_redirect().

Testing Instructions

N/A :-(

Screenshots or screencast

N/A

Changelog Entry

Security - Ensure that code execution stops after calling wp_safe_redirect().

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

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 props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: sjinks <[email protected]>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

2 participants