[GIT-PULLS] [php-src] PR #22767: ext/ftp: apply the connect timeout ceiling to the remaining entry points

[email protected] (iliaal) Thu, 16 Jul 2026 16:24:12 +0000
Newsgroups php.git-pulls
Message-ID <wtJCfQyx4o144gAxReuwNHEQDBWyCyc70a8QzN6yEGI@main.internal.php.net>
Pull Request: https://github.com/php/php-src/pull/22767
Author: iliaal

GH-20601 capped the timeout in `ftp_connect()` so a value that overflows the timeval conversion cannot reach `php_network_set_limit_time()`. `ftp_ssl_connect()` and `ftp_set_option(FTP_TIMEOUT_SEC)` kept rejecting only non-positive values, so PHP_INT_MAX still reached ftp_open() and my_poll() through them. Both now apply the same bound.

The three entry points before this change:

    ftp_connect('127.0.0.1', 1024, PHP_INT_MAX);              // ValueError
    ftp_ssl_connect('127.0.0.1', 1024, PHP_INT_MAX);          // hangs
    ftp_set_option($c, FTP_TIMEOUT_SEC, PHP_INT_MAX);         // bool(true)

Floor PHP-8.4, matching where GH-20601 landed.