diff options
author | Andrew Dolgov <[email protected]> | 2013-03-27 12:21:26 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-27 12:21:26 +0400 |
commit | d3911f80ca897db3644ed1381209533a94a4e5d8 (patch) | |
tree | 4d79762592f87727b70cf6abac827a2780573fd5 /include | |
parent | 884d16505e2c4502ec4438a7e987855683a2d75d (diff) |
fetch_file_contents: fix fetching protected feeds when password has special characters
Diffstat (limited to 'include')
-rw-r--r-- | include/functions.php | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/functions.php b/include/functions.php index 66e9c1376..c0fccf25e 100644 --- a/include/functions.php +++ b/include/functions.php @@ -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]; } |