Skip to content

Avoid null strtolower deprecation in route affinity middleware #139

Description

@chubes4

Problem

Booting the Shop site through WP-CLI on PHP 8.4 repeatedly emits:

Deprecated: strtolower(): Passing null to parameter #1 ($string) of type string is deprecated in inc/middleware/route-affinity.php on line 166

Reproduction:

wp --path=/var/www/extrachill.com --url=shop.extrachill.com eval 'echo get_current_blog_id();'

The warning repeats for route registrations whose method/affinity input is null.

Expected

Normalize the nullable input to a string or reject it before strtolower() without changing valid route-affinity behavior. Add coverage for null/missing route metadata on PHP 8.4.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions