mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-20 15:51:28 +00:00
fetch_file_contents: fix fetching protected feeds when password has special characters
This commit is contained in:
@@ -287,8 +287,6 @@
|
||||
}
|
||||
|
||||
function fetch_file_contents($url, $type = false, $login = false, $pass = false, $post_query = false, $timeout = false) {
|
||||
$login = urlencode($login);
|
||||
$pass = urlencode($pass);
|
||||
|
||||
global $fetch_last_error;
|
||||
|
||||
@@ -350,11 +348,13 @@
|
||||
|
||||
return $contents;
|
||||
} else {
|
||||
if ($login && $pass ){
|
||||
if ($login && $pass){
|
||||
$url_parts = array();
|
||||
|
||||
preg_match("/(^[^:]*):\/\/(.*)/", $url, $url_parts);
|
||||
|
||||
$pass = urlencode($pass);
|
||||
|
||||
if ($url_parts[1] && $url_parts[2]) {
|
||||
$url = $url_parts[1] . "://$login:$pass@" . $url_parts[2];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user