diff options
author | CiaranG <ciaran@ciarang.com> | 2009-03-21 14:18:38 +0000 |
---|---|---|
committer | CiaranG <ciaran@ciarang.com> | 2009-03-21 14:18:38 +0000 |
commit | c4072ef7c930b82b74f8e90f6554974b761c686c (patch) | |
tree | dd66433020966f2241c8fe791a0ed2f63ca6b896 /lib/rssaction.php | |
parent | 8ba43f18cdfad31415bc9e26b2d4be9e9b4465c0 (diff) |
RSS 1.0 actions were reading the stream from the database twice. Inefficient, but more importantly made notice search RSS fail with a DB error due to double search on a DB_DataObject instance
Diffstat (limited to 'lib/rssaction.php')
-rw-r--r-- | lib/rssaction.php | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/lib/rssaction.php b/lib/rssaction.php index 66c2d9e8c..ddba862dc 100644 --- a/lib/rssaction.php +++ b/lib/rssaction.php @@ -94,11 +94,11 @@ class Rss10Action extends Action function handle($args) { - // Get the list of notices - $this->notices = $this->getNotices(); // Parent handling, including cache check parent::handle($args); - $this->showRss($this->limit); + // Get the list of notices + $this->notices = $this->getNotices($this->limit); + $this->showRss(); } /** @@ -132,15 +132,13 @@ class Rss10Action extends Action return null; } - function showRss($limit=0) + function showRss() { - $notices = $this->getNotices($limit); - $this->initRss(); - $this->showChannel($notices); + $this->showChannel(); $this->showImage(); - foreach ($notices as $n) { + foreach ($this->notices as $n) { $this->showItem($n); } @@ -148,7 +146,7 @@ class Rss10Action extends Action $this->endRss(); } - function showChannel($notices) + function showChannel() { $channel = $this->getChannel(); @@ -167,7 +165,7 @@ class Rss10Action extends Action $this->elementStart('items'); $this->elementStart('rdf:Seq'); - foreach ($notices as $notice) { + foreach ($this->notices as $notice) { $this->element('sioct:MicroblogPost', array('rdf:resource' => $notice->uri)); } |