• Resolved Lena Stergatou

    (@lenasterg)


    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 413

    Replace 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 1268

    Replace 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 1295

    Replace the line 75 in class-r34ics.php:
    ‘method’ => null,
    with:
    ‘method’ => ”

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author room34

    (@room34)

    Thanks… I haven’t really had a chance to test the plugin against PHP 8.1 yet, so I wasn’t aware of these issues. I’ll address them in the next update.

    Thread Starter Lena Stergatou

    (@lenasterg)

    Hi.
    The deprecated errors for PHP 8.1 are still there for version 9.9.1

    Plugin Author room34

    (@room34)

    Yes… sorry, the latest round of updates ended up focused on other things and did not include addressing these deprecation notices. This should be in the next update.

    Be sure to check the changelog to see what is addressed in each update.

    Plugin Author room34

    (@room34)

    I prioritized addressing this issue and it should now be fixed in version 10.0.0.

    This is a bit of a thorny issue (and honestly seems like a bad decision in PHP 8.1, in my opinion) in that the PHP docs don’t provide a comprehensive list of the affected core functions. But I think the changes I’ve made here should catch them all.

    Also bear in mind that in PHP 8.1 these are only deprecation notices, not errors, and should not have any effect on functionality. (Still, I want to fix them if they’re present.)

    I bumped the version number to 10 because I’m also introducing a big jump in the version of the ICS Parser library included in the plugin, although it looks like the changes are relatively minor… but they do also include fixing another deprecation issue with PHP 8.1.

    This version also includes a few unrelated bug fixes and translation updates.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Fix suggestions for PHP 8.1’ is closed to new replies.