Skip to content

getCountryCodeFromIpInDatabase breaks on testing with sqlite #52

@garbast

Description

@garbast

Because of the usage of inet_aton, the redirect breaks in acceptance tests, causing a test fail as no error 500 are allowed by the testing framework.

Currently we disable the redirect check with countryredirect_disable but that is only a plug not realy a fix.

A fix for sqlite would be to register a custom function inet_aton, but that wouldn't fix it for other sql databases like postgresql.

My proposal would be, to convert the ips with an command to integer values, using this pattern 1.0.0.12 = (1×256³ + 0×256² + 0×256 + 12) and call the query with an equaly converted value of $ipAddress.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions