laminas-http icon indicating copy to clipboard operation
laminas-http copied to clipboard

Allow laminas/laminas-validator 3.0

Open marcelthole opened this issue 7 months ago • 2 comments

Q A
BC Break no

Description

This is the preparation PR for the release of https://github.com/laminas/laminas-validator/tree/3.0.x

As far as i see there aren't any BC breaks here in this package because there is only this usage of the Hostname Validator:

            // set up a validator that check if the hostname is legal (not spoofed)
            $hostnameValidator = new HostnameValidator([
                'allow'       => HostnameValidator::ALLOW_ALL,
                'useIdnCheck' => false,
                'useTldCheck' => false,
            ]);
            // If invalid. Reset the host & port
            if (! $hostnameValidator->isValid($host)) {
                $host = null;
                $port = null;
            }

All of these options and methods are still available in the unreleased 3.0.x branch

The important change would be this signature change

public function isValid(mixed $value): bool

https://github.com/laminas/laminas-validator/blob/3.0.x/src/Hostname.php#L1814

But in the current implementation of laminas-http the $host variable is string and i think this should be fine

marcelthole avatar Jul 17 '24 12:07 marcelthole