Skip to content

Conversation

@oguilleux
Copy link

This pull request fixes issue regarding deprecated warnings for php 8 because $post_id is passed null in str_replace and preg_replace.

It will apply the following changes :

  • make sure $post_id is always defined in Helpers/original_option_id method
  • make sure $post_id is always defined in Main/get_default_reference method

@oguilleux oguilleux changed the title suppress deprecated warning on php 8.2.0 because $post is null on 404 pages suppress deprecated warning on php 8.2.0 because $post_id is null on 404 pages Oct 20, 2023
@mikkosiikaniemi
Copy link

We are seeing similar PHP deprecated warnings appearing after upgrading from PHP 7.4 to PHP 8.1. Suggesting merging this pull request.

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/plugins/acf-options-for-polylang/classes/helpers.php on line 38

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /wp-content/plugins/acf-options-for-polylang/classes/main.php on line 58

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