Skip to content

Conversation

@jhuhta
Copy link

@jhuhta jhuhta commented Sep 28, 2023

This fixes a deprecation error:

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/vendor/h5p/h5p-core/h5p.classes.php on line 1763

The error is given in Drupal on PHP 8.1 when saving a node with a H5P element.

@pjotrsavitski
Copy link

Thumbs up for the refactoring of str_replace functions enclosed into one another, although the code could be even more concise if you remove the empty check and just use the $value ?? '' instead. It will still be as readable and give the same result.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants