-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
[stable16] Correctly handle emtpy string in proxyuserpwd config #17511
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
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 <[email protected]>
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -112,12 +112,16 @@ private function getCertBundle() { | |||||
| * | ||||||
| * @return string | ||||||
| */ | ||||||
| private function getProxyUri(): string { | ||||||
| $proxyHost = $this->config->getSystemValue('proxy', null); | ||||||
| $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', null); | ||||||
| private function getProxyUri(): ?string { | ||||||
| $proxyHost = $this->config->getSystemValue('proxy', ''); | ||||||
| if ($proxyHost === '' || $proxyHost === null) { | ||||||
| return null; | ||||||
| } | ||||||
|
|
||||||
| $proxyUserPwd = $this->config->getSystemValue('proxyuserpwd', ''); | ||||||
| $proxyUri = ''; | ||||||
|
|
||||||
| if ($proxyUserPwd !== null) { | ||||||
| if ($proxyUserPwd === '' || $proxyUserPwd === null) { | ||||||
| $proxyUri .= $proxyUserPwd . '@'; | ||||||
|
||||||
| $proxyUri .= $proxyUserPwd . '@'; | |
| return $proxyHost; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lets keep the backport as identical as we can to the original. Then we can do what you suggest in a PR against master ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#14363 is not totally needed, to fix the issue that proxy is set to '@' when the documented default values are used in config.php instead of null.
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dead code