1
1
Fork 0

suppress some scraping errors when confronted with hybrid/strange

feeds that provide insufficient content-type and choke the html parser.
This commit is contained in:
Friendika 2011-02-02 14:48:27 -08:00
commit ee45dee932
2 changed files with 21 additions and 2 deletions

View file

@ -1366,6 +1366,7 @@ function lrdd($uri) {
else {
$html = fetch_url($uri);
$headers = $a->get_curl_headers();
logger('lrdd: headers=' . $headers, LOGGER_DEBUG);
$lines = explode("\n",$headers);
if(count($lines)) {
foreach($lines as $line) {
@ -1377,6 +1378,8 @@ function lrdd($uri) {
// don't try and run feeds through the html5 parser
if(stristr($line,'content-type:') && ((stristr($line,'application/atom+xml')) || (stristr($line,'application/rss+xml'))))
return array();
if(stristr($html,'<rss') || stristr($html,'<feed'))
return array();
}
}
if(! isset($link)) {