-
Bug
-
Resolution: Fixed
-
Blocker
-
3.0.x
-
None
-
PHP Environment:
Database:
This was found in 3.0.6-RC3's feed.php. It looks to me like the version in SVN trunk (http://code.phpbb.com/svn/phpbb/trunk/phpBB/feed.php) has the same issue.
Incorrect results are served if you fetch multiple individual forum/topic feeds within $cache_time. I.e. fetch feed.php?f=1, feed.php?f=2, feed.php?f=3, ... within cache_time, and all will contain the same data. This only applies to anon/guests, as the cache is auto-inhibited for logged in users. I think it applies to bots too.
Very quick workaround (not ideal): $cache_time=0;
Most obvious fix that springs to mind, in phpbb_feed::get_item():
Find:
// Try to load result set...
|
$cache_filename = substr(get_class($this), strlen('phpbb_'));
|
Add:
if (!$this->topic_id && $this->forum_id)
|
{
|
$cache_filename .= '_forum_' . $this->forum_id;
|
}
|
else if ($this->topic_id)
|
{
|
$cache_filename .= '_topic_' . $this->topic_id;
|
}
|
This does raise the issue of potentially creating a very large number of files in the cache directory, which is not exactly ideal, but retaining caching without creating so many files would need quite a bit more work - that's the quick fix and should be ok on smaller boards, I'd guess.
One relatively obvious way of addressing the number of cache files would be to store the results in a simple (forum_id, topic_id, timestamp, data) DB table.
- is duplicated by
-
PHPBB-8807 RSS Feeds give wrong results
- Closed