Commit 94c1c06d authored by Kjartan's avatar Kjartan

- Report XML parse errors.

parent f78cb993
......@@ -312,13 +312,18 @@ function aggregator_refresh($feed) {
$channel = aggregator_parse_feed($result->data, $feed);
if ($result->headers['Last-Modified']) {
$modified = strtotime($result->headers['Last-Modified']);
}
if (is_array($channel)) {
if ($result->headers['Last-Modified']) {
$modified = strtotime($result->headers['Last-Modified']);
}
db_query("UPDATE {feed} SET url = '%s', checked = %d, link = '%s', description = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel["LINK"], $channel["DESCRIPTION"], $result->headers['ETag'], $modified, $feed["fid"]);
db_query("UPDATE {feed} SET url = '%s', checked = %d, link = '%s', description = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel["LINK"], $channel["DESCRIPTION"], $result->headers['ETag'], $modified, $feed["fid"]);
return t("syndicated content from '%site'.", array("%site" => $feed["title"]));
return t("syndicated content from '%site'.", array("%site" => $feed["title"]));
}
else {
return $channel;
}
default:
return t("failed to parse RSS feed '%site': %error.", array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error));
}
......
......@@ -312,13 +312,18 @@ function aggregator_refresh($feed) {
$channel = aggregator_parse_feed($result->data, $feed);
if ($result->headers['Last-Modified']) {
$modified = strtotime($result->headers['Last-Modified']);
}
if (is_array($channel)) {
if ($result->headers['Last-Modified']) {
$modified = strtotime($result->headers['Last-Modified']);
}
db_query("UPDATE {feed} SET url = '%s', checked = %d, link = '%s', description = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel["LINK"], $channel["DESCRIPTION"], $result->headers['ETag'], $modified, $feed["fid"]);
db_query("UPDATE {feed} SET url = '%s', checked = %d, link = '%s', description = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel["LINK"], $channel["DESCRIPTION"], $result->headers['ETag'], $modified, $feed["fid"]);
return t("syndicated content from '%site'.", array("%site" => $feed["title"]));
return t("syndicated content from '%site'.", array("%site" => $feed["title"]));
}
else {
return $channel;
}
default:
return t("failed to parse RSS feed '%site': %error.", array('%site' => $feed['title'], '%error' => $result->code .' '. $result->error));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment