Skip to content

Fix unslashed REMOTE_ADDR warning in email provider - #975

Open
masteradhoc wants to merge 3 commits into
WordPress:masterfrom
masteradhoc:MissingUnslash
Open

Fix unslashed REMOTE_ADDR warning in email provider#975
masteradhoc wants to merge 3 commits into
WordPress:masterfrom
masteradhoc:MissingUnslash

Conversation

@masteradhoc

@masteradhoc masteradhoc commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

What?

This fixes the remaining Plugin Check warning outside of the intentionally skipped includes files.

The email provider now applies wp_unslash() to $_SERVER['REMOTE_ADDR'] before the existing sanitization step, matching WordPress input-handling expectations while preserving the current output filtering.

Validation: npm run lint:php -- providers/class-two-factor-email.php passes.

Fixes #

Why?

Pass the Plugin Check Checks

How?

Changelog Entry

Fixed - Unslash REMOTE_ADDR before sanitizing it in the email provider.

Open WordPress Playground Preview

@masteradhoc masteradhoc added this to the 0.17.0 milestone Sep 8, 2026
@masteradhoc masteradhoc self-assigned this Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

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: masteradhoc <masteradhoc@git.wordpress.org>

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

The functional change is minimal and aligns with WordPress sanitization expectations; only a minor inline-comment grammar nit was found.

Pull request overview

This PR updates the Two-Factor Email provider to unslash $_SERVER['REMOTE_ADDR'] before sanitizing it, resolving a remaining Plugin Check warning (outside the intentionally skipped includes/ files) while keeping the existing character allowlist filtering.

Changes:

  • Apply wp_unslash() to $_SERVER['REMOTE_ADDR'] before the existing preg_replace() sanitization in the Email provider.
File summaries
File Description
providers/class-two-factor-email.php Unslashes REMOTE_ADDR prior to sanitization to align with WordPress input-handling expectations and address Plugin Check warnings.
Review details
  • Files reviewed: 1/1 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread providers/class-two-factor-email.php Outdated
masteradhoc and others added 2 commits September 8, 2026 21:11
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.

2 participants