opensoft / doctrine-postgres-types

Provide common Doctrine types for Postgres in use at Opensoft
68 stars 25 forks source link

INET type throws error on correct value #20

Open sspat opened 3 years ago

sspat commented 3 years ago

Given an IPv6 value of ::ffff:10.233.65.138, I cannot save it to the database, as the regexp validation in \Doctrine\DBAL\PostgresTypes\InetType::convertToDatabaseValue does not pass for it.

This value passes a check with filter_var

var_dump(filter_var('::ffff:10.233.65.138', FILTER_VALIDATE_IP, FILTER_FLAG_IPV6)); // string(20) "::ffff:10.233.65.138"
sspat commented 3 years ago

PostgreSQL also is accepting this value in a column of type inet

simPod commented 3 years ago

IMO there's no need for inet validation in the type