diff options
author | Scott Shambarger <devel@shambarger.net> | 2019-08-02 15:18:01 -0700 |
---|---|---|
committer | Roeland Jago Douma <roeland@famdouma.nl> | 2019-08-11 21:07:30 +0200 |
commit | edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769 (patch) | |
tree | b1adc90ab2e142a6e0fd9b7643450bef33dc9d1a /lib/private | |
parent | 1d72073e349bf6926a13c085495c44fce2406e61 (diff) | |
download | nextcloud-server-edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769.tar.gz nextcloud-server-edf946dfc7c8ddc5f4ad125d2a0c780bbc63e769.zip |
Correctly handle emtpy string in proxyuserpwd config
As documented, the default value for config value proxyuserpwd is ''.
However, that value results in the error:
"cURL error 5: Unsupported proxy syntax in '@'".
This patch handles the values of '' and null (the default in the code)
the same for config values proxyuserpwd and proxy.
Signed-off-by: Scott Shambarger <devel@shambarger.net>
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Http/Client/Client.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/Http/Client/Client.php b/lib/private/Http/Client/Client.php index ad51feca0be..993b83917fd 100644 --- a/lib/private/Http/Client/Client.php +++ b/lib/private/Http/Client/Client.php @@ -95,15 +95,15 @@ class Client implements IClient { * @return string|null */ private function getProxyUri(): ?string { - $proxyHost = $this->config->getSystemValue('proxy', null); + $proxyHost = $this->config->getSystemValue('proxy', ''); - if ($proxyHost === null) { + if ($proxyHost === '' || $proxyHost === null) { return null; } - $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); + $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', ''); - if ($proxyUserPwd === null) { + if ($proxyUserPwd === '' || $proxyUserPwd === null) { return $proxyHost; } |