• Resolved imackinnon

    (@imackinnon)


    oauth2-provider/includes/admin-options.php makes two calls to add_submenu_page with a null first parameter, starting on line 52. This causes a null path to be sent to various built in string functions which no longer accept null arguments (via wp_normalize_path in wp-includes/functions.php).

    In PHP 8.1 this causes deprecation warnings whenever the WordPress dashboard is visited, and presumably this will cause errors in future versions of PHP. Eg.:

    PHP Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated

    WordPress developers have said the functions are designed only to take strings and they won’t protect against null values (https://core.trac.www.ads-software.com/ticket/58772).

    Replacing the null parameters with empty strings appears to solve the problem, but I don’t know whether this may have other unexpected consequences.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Justin Greer

    (@justingreerbbi)

    Thanks for posting. I am working on an update and will look into this. Also, thanks for the reference.

    Plugin Author Justin Greer

    (@justingreerbbi)

    After consulting with some other developers and the team, this will be addressed in the update that will be out shortly.

    Thanks again

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘add_submenu_page call causing Deprecation warnings in PHP 8.1’ is closed to new replies.