Skip to content
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

Refactor some cURL options and use CURLOPT_USERPWD #6177

Merged
merged 3 commits into from
Mar 10, 2024

Conversation

Alkarex
Copy link
Member

@Alkarex Alkarex commented Mar 6, 2024

fix #6176

P.S. It started as a little fix and turned into a slightly larger refactoring to address all related cases.

app/Models/Feed.php Outdated Show resolved Hide resolved
public function curlOptions(): array {
$curl_options = [];
if ($this->httpAuth !== '') {
$curl_options[CURLOPT_USERPWD] = htmlspecialchars_decode($this->httpAuth, ENT_QUOTES);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The main change is here :-)

$url = htmlspecialchars_decode($this->url, ENT_QUOTES);
if ($this->httpAuth != '') {
$url = preg_replace('#((.+)://)(.+)#', '${1}' . $this->httpAuth . '@${3}', $url) ?? '';
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is how we did before

@Alkarex Alkarex merged commit d0072b9 into FreshRSS:edge Mar 10, 2024
2 checks passed
@Alkarex Alkarex deleted the CURLOPT_USERPWD branch March 10, 2024 22:04
Alkarex added a commit to Alkarex/FreshRSS that referenced this pull request May 25, 2024
Alkarex added a commit that referenced this pull request May 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] http auth fails " cURL error 6: Could not resolve host"
1 participant