merge branch 'master' of github.com:danog/MadelineProto into master

This commit is contained in:
Daniil Gentili 2020-10-05 19:29:15 +02:00
commit e5ab5cabac
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -135,7 +135,8 @@ class Connection extends SettingsAbstract
$this->setRetry(false);
}
if (isset($settings['proxy'])) {
foreach (\is_iterable($settings['proxy']) ? $settings['proxy'] : [$settings['proxy']] as $key => $proxy) {
$isProxyArray = \is_iterable($settings['proxy']);
foreach ($isProxyArray ? $settings['proxy'] : [$settings['proxy']] as $key => $proxy) {
if ($proxy === '\\Socket') {
$proxy = DefaultStream::class;
} elseif ($proxy === '\\SocksProxy') {
@ -146,7 +147,7 @@ class Connection extends SettingsAbstract
$proxy = ObfuscatedStream::class;
}
if ($proxy !== DefaultStream::class) {
$this->addProxy($proxy, $settings['proxy_extra'][$key]);
$this->addProxy($proxy, $isProxyArray ? $settings['proxy_extra'][$key] : $settings['proxy_extra']);
}
}
}