summaryrefslogtreecommitdiff
path: root/feed.php
diff options
context:
space:
mode:
authorMichael Hamann <michael@content-space.de>2013-01-11 01:15:09 +0100
committerMichael Hamann <michael@content-space.de>2013-01-11 11:52:29 +0100
commit1512eb894e36e3bccfe8e99736bb9d33ebe75beb (patch)
treef3d4ab503134c59f79ead037e157cd2bcd375c78 /feed.php
parentffb060ea6b02211074dfc314f8651936065b3f7f (diff)
downloadrpg-1512eb894e36e3bccfe8e99736bb9d33ebe75beb.tar.gz
rpg-1512eb894e36e3bccfe8e99736bb9d33ebe75beb.tar.bz2
Fix content of pages with incorrect metadata in list feeds
Before this change the last modification time was taken from metadata and then the revision that was specified there was loaded from the attic. Now revisions from attic are only loaded when the page has been modified more recently and the date is normally the last modification time of the page source. This was a problem when the most recent change was an external edit, then an older revision was shown in the feed.
Diffstat (limited to 'feed.php')
-rw-r--r--feed.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/feed.php b/feed.php
index 9e5c5c6b5..7803982b8 100644
--- a/feed.php
+++ b/feed.php
@@ -209,12 +209,14 @@ function rss_buildItems(&$rss, &$data, $opt) {
// add date
if($ditem['date']) {
$date = $ditem['date'];
+ } elseif ($ditem['media']) {
+ $date = @filemtime(mediaFN($id));
+ } elseif (@file_exists(wikiFN($id))) {
+ $date = @filemtime(wikiFN($id));
} elseif($meta['date']['modified']) {
$date = $meta['date']['modified'];
- } else if ($ditem['media']) {
- $date = @filemtime(mediaFN($id));
} else {
- $date = @filemtime(wikiFN($id));
+ $date = 0;
}
if($date) $item->date = date('r', $date);
@@ -350,7 +352,11 @@ function rss_buildItems(&$rss, &$data, $opt) {
$content = '';
}
} else {
- $content = p_wiki_xhtml($id, $date, false);
+ if (@filemtime(wikiFN($id)) === $date) {
+ $content = p_wiki_xhtml($id, '', false);
+ } else {
+ $content = p_wiki_xhtml($id, $date, false);
+ }
// no TOC in feeds
$content = preg_replace('/(<!-- TOC START -->).*(<!-- TOC END -->)/s', '', $content);