better feed url checking

This commit is contained in:
Andrew Dolgov 2010-11-20 16:23:23 +03:00
parent db4e4539dc
commit ec39a02cd8
1 changed files with 7 additions and 2 deletions

View File

@ -2892,7 +2892,8 @@
$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)) {
@ -6450,7 +6451,11 @@
if (strpos($url, '/', strpos($url, ':') + 3) === false) {
$url .= '/';
}
return $url;
if ($url != "http:///")
return $url;
else
return '';
}
function validate_feed_url($url) {