Repository navigation
[2.1] Use stream_socket_client instead of fsocketopen if possible - #9862
jdarwood007 wants to merge 1 commit into
Conversation
|
Connecting to the address from $fp = @fsockopen(($match[2] ? 'ssl://' : '') . $ip[0] ?? $match[3], ...);
$match = [2 => 's', 3 => 'example.com'];
$ip = '93.184.215.14';
var_dump(($match[2] ? 'ssl://' : '') . $ip[0] ?? $match[3]); // string(7) "ssl://9"So the fallback never connects. Even written as intended, an The |
f7353dd to
21aba83
Compare
|
I re-ran this against the current head (21aba83). With cURL disabled, so the socket path is the one used, normal fetches work: The fallback still can't help for HTTPS. As PHP evaluates it now: ($match[2] ? 'ssl://' : '') . $ips[0] ?? $match[3]
// 93.184.215.14 -> "ssl://93.184.215.14"
// 2001:db8::1 -> "ssl://2001:db8::1"
Trying each address from |
Fixes #9803