]> git.wh0rd.org Git - tt-rss.git/commitdiff
better feed url checking
authorAndrew Dolgov <fox@fakecake.org>
Sat, 20 Nov 2010 13:23:23 +0000 (16:23 +0300)
committerAndrew Dolgov <fox@fakecake.org>
Sat, 20 Nov 2010 13:23:23 +0000 (16:23 +0300)
functions.php

index 7f287e7cb836b802611825eec43ce3df9fbc860f..7d23a409320c236d66381793848e0f15af030f0d 100644 (file)
                        $auth_login = '', $auth_pass = '') {
 
                $url = fix_url($url);
-               if (!validate_feed_url($url)) return 2;
+
+               if (!$url || !validate_feed_url($url)) return 2;
                if (!fetch_file_contents($url)) return 5;
 
                if (url_is_html($url)) {
                if (strpos($url, '/', strpos($url, ':') + 3) === false) {
                        $url .= '/';
                }
-               return $url;
+
+               if ($url != "http:///")
+                       return $url;
+               else
+                       return '';
        }
 
        function validate_feed_url($url) {