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

Deprecation. Check if the ctype_digit parameter is null #1708

Merged
merged 2 commits into from
Oct 3, 2023

Conversation

amieiro
Copy link
Member

@amieiro amieiro commented Sep 29, 2023

Problem

Using PHP8.2, with a non logged user, when I access to a list of projects, I get a deprecation notice:

PHP Deprecated: ctype_digit(): Argument of type null will be interpreted as string in the future in /wordpress/glotpress/wp-content/plugins/GlotPress/gp-includes/thing.php on line 644

image

Solution

Since PHP 8.1.0, passing a non-string argument to the ctype_digit function is deprecated. More info here.

This PR checks if the argument passed to ctype_digit is not null, avoiding its execution in this situation.

@amieiro amieiro requested review from akirk and trymebytes September 29, 2023 16:39
@amieiro amieiro added the php Pull requests that update Php code label Sep 30, 2023
@amieiro amieiro merged commit f505ecc 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