Fix suggestions for PHP 8.1
-
Hi. Thanks for the great plugin. I installed in a server with PHP 8.1.11 and I got some PHP Deprecated warnings. The fixes were easy so, if you want, you can add them to the next version. For:
PHP Deprecated: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in \wp-content\plugins\ics-calendar\functions.php on line 72
PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in \wp-content\plugins\ics-calendar\functions.php on line 78`
Replace the line 67 in functions.php
function r34ics_date($format, $dt_str=null, $tz=null, $offset=null) {
with the following:
function r34ics_date($format, $dt_str='', $tz=null, $offset='') {
For:
PHP Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in \wp-content\plugins\ics-calendar\functions.php on line 413Replace the line 62 in class-r34ics.php:
‘hiderecurrence’ => null,with the following:
‘hiderecurrence’ => ”,For:
PHP Deprecated: explode(): Passing null to parameter #2 ($string) of type string is deprecated in\wp-content\plugins\ics-calendar\class-r34ics.php on line 1268Replace the line 45 in class-r34ics.php:
‘curlopts’ => null,
with:
‘curlopts’ => ”,For:
PHP Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in\wp-content\plugins\ics-calendar\class-r34ics.php on line 1295Replace the line 75 in class-r34ics.php:
‘method’ => null,
with:
‘method’ => ”
- The topic ‘Fix suggestions for PHP 8.1’ is closed to new replies.