Skip to content

Conversation

@amieiro
Copy link
Member

@amieiro amieiro commented Sep 29, 2023

Problem

Using PHP8.2, when I access to a list of translations in the main table, I get a deprecation notice:

PHP Deprecated: preg_split(): Passing null to parameter #2 ($subject) of type string is deprecated in /wordpress/glotpress/wp-content/plugins/GlotPress/gp-includes/things/translation.php on line 579

image

Solution

Skip the preg_split execution if the second parameter is null.

@amieiro amieiro requested review from akirk and trymebytes September 29, 2023 18:11
@amieiro amieiro changed the title Check if the preg_split parameter is null Deprecation. Check if the preg_split parameter is null Sep 29, 2023
@amieiro amieiro added the php Pull requests that update Php code label Sep 30, 2023
akirk
akirk previously approved these changes Oct 3, 2023
Copy link
Member

@akirk akirk left a comment

Choose a reason for hiding this comment

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

Since the point of this PR is to fix php8 warnings, this is an appropriate fix.

@amieiro amieiro enabled auto-merge (squash) October 3, 2023 11:19
@amieiro amieiro disabled auto-merge October 3, 2023 11:20
@amieiro amieiro requested a review from akirk October 3, 2023 11:25
@amieiro amieiro merged commit d3f570c into GlotPress:develop Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants