8000 Check that CURLPROXY_SOCKS5_HOSTNAME is available · olayakout/codebird-php@eb713df · GitHub
[go: up one dir, main page]

Skip to content

Commit eb713df

Browse files
committed
Check that CURLPROXY_SOCKS5_HOSTNAME is available
1 parent 5b0f999 commit eb713df

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/codebird.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,9 +725,14 @@ public function setProxy($host, $port, $type = CURLPROXY_HTTP)
725725
CURLPROXY_HTTP, CURLPROXY_SOCKS4, CURLPROXY_SOCKS5,
726726
CURLPROXY_SOCKS5_HOSTNAME
727727
];
728+
// PHP 7.0+, keep this as long as PHP 5.6 is supported
728729
if (defined('CURLPROXY_SOCKS4A')) {
729730
$types[] = CURLPROXY_SOCKS4A;
730731
}
732+
// PHP 7.0+, keep this as long as PHP 5.6 is supported
733+
if (defined('CURLPROXY_SOCKS5_HOSTNAME')) {
734+
$types[] = CURLPROXY_SOCKS5_HOSTNAME;
735+
}
731736
if (! in_array($type, $types)) {
732737
throw new \Exception('Invalid proxy type specified.');
733738
}

0 commit comments

Comments
 (0)
0