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 deprecated usage of passing null to explode() #37392

Merged
merged 1 commit into from
Dec 15, 2021

Conversation

noisysocks
Copy link
Member

Description

Same as WordPress/wordpress-develop#2053. Making the change here as well so that it's fixed when running Gutenberg with older versions of WordPress.

As of PHP 8.1, explode() does not permit null as its second argument. This results in warnings being spat out on every page because of a usage of this in wp-includes/block-supports/layout.php.

How has this been tested?

  1. Run WordPress / Gutenberg using PHP 8.1.
  2. Open up any page.
  3. See that there are no longer any warnings about passing null to explode() here.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • I've tested my changes with keyboard and screen readers.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.
  • I've updated all React Native files affected by any refactorings/renamings in this PR (please manually search all *.native.js files for terms that need renaming or removal).

As of PHP 8.1, explode() does not permit null as its second argument.
This results in warnings being spat out on every page because of a usage
of this in wp-includes/block-supports/layout.php.
@noisysocks noisysocks added [Type] Bug An existing feature does not function as intended [Feature] Blocks Overall functionality of blocks Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta labels Dec 15, 2021
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

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

LGTM!

@noisysocks noisysocks merged commit 576c891 into trunk Dec 15, 2021
@noisysocks noisysocks deleted the fix/null-warning-in-php-8.1 branch December 15, 2021 06:03
@github-actions github-actions bot added this to the Gutenberg 12.2 milestone Dec 15, 2021
@tellthemachines tellthemachines removed the Backport to WP 6.7 Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Dec 20, 2021
tellthemachines pushed a commit that referenced this pull request Dec 21, 2021
As of PHP 8.1, explode() does not permit null as its second argument.
This results in warnings being spat out on every page because of a usage
of this in wp-includes/block-supports/layout.php.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Blocks Overall functionality of blocks [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants