]> git.wh0rd.org Git - tt-rss.git/commitdiff
fetch_file_contents: fix fetching protected feeds when password has special characters
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Mar 2013 08:21:26 +0000 (12:21 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Mar 2013 08:21:26 +0000 (12:21 +0400)
include/functions.php

index 66e9c1376a3f7c401c9be23a77906e67ce122799..c0fccf25e8db03611d01b10d71aa685a9cc14efd 100644 (file)
        }
 
        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;
 
 
                        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];
                                }