Prevent PHP notice by validating and sanitizing GET parameter#232
Open
divyadhiman22 wants to merge 1 commit into
Open
Prevent PHP notice by validating and sanitizing GET parameter#232divyadhiman22 wants to merge 1 commit into
divyadhiman22 wants to merge 1 commit into
Conversation
desrosj
requested changes
May 27, 2026
Member
There was a problem hiding this comment.
Hi @divyadhiman22 and thanks for this PR!
This PR does not make any changes to how this GET parameter is handled. It simply moves the phpcs:ignore statement to a new line and adds an inline comment.
Also, it's not clear what the actual notice is you're seeing in PHP. Could you share that with steps to reproduce?
Without those steps, I don't think that there is actually anything to fix here, unless a true nonce check is added out of the abundance of caution.
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.
What does this PR do?
This PR adds validation and sanitization for a GET parameter to prevent
PHP notices and improve security.
Why is this change needed?
Accessing undefined indexes can cause PHP warnings and unexpected behavior.
How was this tested?
Tested locally using WordPress and verified editor switching works correctly.