Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incompatibilities with PHP 8.1 #2668

Merged
merged 5 commits into from
Dec 7, 2021
Merged

Fix incompatibilities with PHP 8.1 #2668

merged 5 commits into from
Dec 7, 2021

Conversation

sjinks
Copy link
Member

@sjinks sjinks commented Nov 26, 2021

Description

This PR fixes incompatibilities with PHP 8.1 described in #2667.

Changelog Description

Plugin Updated: VIP Init

Fix incompatibilities with PHP 8.1

Plugin Updated: VIP Search

Fix incompatibilities with PHP 8.1

Plugin Updated: VIP Helpers

Fix incompatibilities with PHP 8.1

Checklist

Please make sure the items below have been covered before requesting a review:

  • This change works and has been tested locally (or has an appropriate fallback).
  • This change works and has been tested on a Go sandbox.
  • This change has relevant unit tests (if applicable).
  • This change has relevant documentation additions / updates (if applicable).
  • I've created a changelog description that aligns with the provided examples.

Steps to Test

The CI should pass; PHP 8.1 will still fail.

// phpcs:ignore WordPress.Security.NonceVerification.Recommended
$enable = filter_var( $_GET['a8c-debug'] ?? '', FILTER_SANITIZE_STRING );
// phpcs:ignore WordPress.Security.NonceVerification.Recommended, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized
$enable = $_GET['a8c-debug'] ?? '';
Copy link
Contributor

Choose a reason for hiding this comment

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

Could sanitize_text_field() be used here?

Copy link
Member Author

Choose a reason for hiding this comment

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

@GaryJones yes, but we use $enable only to compare its value against two predefined constants, that is why I decided not to waste CPU cycles.

Copy link
Contributor

Choose a reason for hiding this comment

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

Makes sense.

@sjinks sjinks merged commit 83d7293 into master Dec 7, 2021
@sjinks sjinks deleted the add/php81-compat branch December 7, 2021 09:53
@sjinks
Copy link
Member Author

sjinks commented Dec 7, 2021

r2055-stacks

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

Successfully merging this pull request may close these issues.

4 participants