Skip to content

Fix WordPress.Security.ValidatedSanitizedInput.InputNotValidated error#356

Merged
jeffpaul merged 3 commits into10up:developfrom
jspellman814:possibly-undefined-index
Jan 2, 2024
Merged

Fix WordPress.Security.ValidatedSanitizedInput.InputNotValidated error#356
jeffpaul merged 3 commits into10up:developfrom
jspellman814:possibly-undefined-index

Conversation

@jspellman814
Copy link
Copy Markdown
Contributor

Description of the Change

This PR fixes the following error thrown by the VIP Code Analysis Bot:

Error( severity 5 ): Detected usage of a possibly undefined superglobal array index: $_SERVER['REQUEST_URI']. Use isset() or empty() to check the index exists before using it (WordPress.Security.ValidatedSanitizedInput.InputNotValidated).

If it doesn't make sense for you all to merge the work in this PR, feel free to close. Thank you!

Closes #

How to test the Change

Changelog Entry

Changed - Existing functionality

Address the issue of a possibly undefined superglobal array index by introducing a concise and effective way to handle potential null values.

Credits

Props @jspellman814

Checklist:

  • I agree to follow this project's Code of Conduct.
  • I have updated the documentation accordingly.
  • I have added tests to cover my change.
  • All new and existing tests pass.

@jspellman814 jspellman814 requested a review from a team as a code owner November 13, 2023 20:33
@jspellman814 jspellman814 requested review from ravinderk and removed request for a team November 13, 2023 20:33
@jeffpaul jeffpaul added this to the 2.2.0 milestone Nov 13, 2023
Copy link
Copy Markdown
Contributor

@ravinderk ravinderk left a comment

Choose a reason for hiding this comment

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

@jspellman814 Thank you for your contribution. I added a minor request. Feel free to ask questiona.

Comment thread inc/classes/class-srm-redirect.php Outdated
@jeffpaul jeffpaul merged commit 419c15e into 10up:develop Jan 2, 2024
@dkotter dkotter modified the milestones: 2.2.0, 2.1.1 Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants