Skip to content

Fix inverted caching logic#4104

Open
johngodley wants to merge 1 commit intotrunkfrom
fix/inverted-cache-logic
Open

Fix inverted caching logic#4104
johngodley wants to merge 1 commit intotrunkfrom
fix/inverted-cache-logic

Conversation

@johngodley
Copy link
Owner

Somehow got inverted during the lint changes

Copilot AI review requested due to automatic review settings January 17, 2026 08:07
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes inverted caching logic in the WordPress redirect module that was inadvertently introduced during lint changes. The function cache_unmatched_redirects() had two logic errors: it was returning early when there was NO match (opposite of intended behavior), and it was caching the matched value instead of explicitly caching false for unmatched redirects.

Changes:

  • Corrected the conditional check to return early when a redirect IS matched (changed === to !==)
  • Fixed the cached value to explicitly store false instead of using $this->matched

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

1 participant