diff options
author | Dries Buytaert <dries@buytaert.net> | 2004-10-03 10:03:52 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2004-10-03 10:03:52 +0000 |
commit | aa6d81c19eaf7547a5fd5af78e2eb9fa6184676b (patch) | |
tree | 4d4d3e6e638f6bf6421cf51c4f5f1b9dc34c1626 /modules/aggregator/aggregator.module | |
parent | 327a256a2e701efbf39e985791526f883ee4ffbe (diff) | |
download | brdo-aa6d81c19eaf7547a5fd5af78e2eb9fa6184676b.tar.gz brdo-aa6d81c19eaf7547a5fd5af78e2eb9fa6184676b.tar.bz2 |
- Modified version of patch #11099 by Alan Chandler:
+ Fixed problem with channel data not being trimmed.
+ Made some queries ANSI SQL so they work with PostgreSQL.
Diffstat (limited to 'modules/aggregator/aggregator.module')
-rw-r--r-- | modules/aggregator/aggregator.module | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module index 0922606b5..7adbb24b8 100644 --- a/modules/aggregator/aggregator.module +++ b/modules/aggregator/aggregator.module @@ -363,6 +363,14 @@ function aggregator_refresh($feed) { } /* + ** Prepare the channel data: + */ + + foreach ($channel as $key => $value) { + $channel[$key] = trim(strip_tags($value)); + } + + /* ** Prepare the image data (if any): */ @@ -381,7 +389,7 @@ function aggregator_refresh($feed) { ** Update the feed data: */ - db_query("UPDATE {aggregator_feed} SET url = '%s', checked = %d, link = '%s', description = '%s', image = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), strip_tags($channel['LINK']), strip_tags($channel['DESCRIPTION']), $image, $result->headers['ETag'], $modified, $feed['fid']); + db_query("UPDATE {aggregator_feed} SET url = '%s', checked = %d, link = '%s', description = '%s', image = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel['LINK'], $channel['DESCRIPTION'], $image, $result->headers['ETag'], $modified, $feed['fid']); /* ** Clear the cache: @@ -948,7 +956,7 @@ function _aggregator_page_list($sql, $op, $header = '') { * Menu callback; displays all the feeds used by the aggregator. */ function aggregator_page_sources() { - $result = db_query('SELECT f.fid, f.title, f.description, f.image, MAX(i.timestamp) AS last FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY fid'); + $result = db_query('SELECT f.fid, f.title, f.description, f.image, MAX(i.timestamp) AS last FROM {aggregator_feed} f LEFT JOIN {aggregator_item} i ON f.fid = i.fid GROUP BY f.fid'); $output = "<div id=\"aggregator\">\n"; while ($feed = db_fetch_object($result)) { $output .= "<h2>$feed->title</h2>\n"; @@ -998,7 +1006,7 @@ function aggregator_page_opml() { * Menu callback; displays all the categories used by the aggregator. */ function aggregator_page_categories() { - $result = db_query('SELECT c.cid, c.title, c.description FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid LEFT JOIN {aggregator_item} i ON ci.iid = i.iid GROUP BY cid'); + $result = db_query('SELECT c.cid, c.title, c.description FROM {aggregator_category} c LEFT JOIN {aggregator_category_item} ci ON c.cid = ci.cid LEFT JOIN {aggregator_item} i ON ci.iid = i.iid GROUP BY c.cid, c.title, c.description'); $output = "<div id=\"aggregator\">\n"; while ($category = db_fetch_object($result)) { |