Skip to content

Efficiency #12

@bert-w

Description

@bert-w

return in_array($ip, abuse_ips(), true);

Why do you do an in_array check here instead of an array_key_exists? You probably want to flip this whole array so you can do a key lookup in O(1). It is horribly inefficient to use an array lookup this way since the abuse-ip array consists of over 53k IPs (and this middleware runs on every request).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions