Passing null parameter to str_replace() makes wordpress debug to give an error on PHP > 8.1
Error
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-content/plugins/highlighting-code-block/class/loos_hcb.php on line 79
Environment
Using PHP 8.3
Fix
/highlighting-code-block/class/loos_hcb.php
Rule number 80
Situation Now
$content = str_replace( 'prism on-numbers', 'prism line-numbers', $content );
Proposal
$content = str_replace( 'prism on-numbers', 'prism line-numbers', $content ?? '');
References
https://magento.stackexchange.com/posts/369717/timeline
tested and error message is gone
Passing null parameter to str_replace() makes wordpress debug to give an error on PHP > 8.1
Error
Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/html/wp-content/plugins/highlighting-code-block/class/loos_hcb.php on line 79
Environment
Using PHP 8.3
Fix
/highlighting-code-block/class/loos_hcb.phpRule number 80
Situation Now
Proposal
References
https://magento.stackexchange.com/posts/369717/timeline
tested and error message is gone