summaryrefslogtreecommitdiff
path: root/modules/aggregator.module
diff options
context:
space:
mode:
authorKjartan Mannes <kjartan@2.no-reply.drupal.org>2004-01-08 19:29:10 +0000
committerKjartan Mannes <kjartan@2.no-reply.drupal.org>2004-01-08 19:29:10 +0000
commit94c1c06d8abf2b003d364a3642a1a9fad5154179 (patch)
tree98c334567cd855a68bc4db2ffa0d706f87d13b53 /modules/aggregator.module
parentf78cb9932b36b8f16b91f1a9e08d2bdf3f736b1e (diff)
downloadbrdo-94c1c06d8abf2b003d364a3642a1a9fad5154179.tar.gz
brdo-94c1c06d8abf2b003d364a3642a1a9fad5154179.tar.bz2
- Report XML parse errors.
Diffstat (limited to 'modules/aggregator.module')
-rw-r--r--modules/aggregator.module15
1 files changed, 10 insertions, 5 deletions
diff --git a/modules/aggregator.module b/modules/aggregator.module
index 91752bf8a..52330386c 100644
--- a/modules/aggregator.module
+++ b/modules/aggregator.module
@@ -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));
}