diff options
author | Ben Coburn <btcoburn@silicodon.net> | 2006-12-08 07:59:33 +0100 |
---|---|---|
committer | Ben Coburn <btcoburn@silicodon.net> | 2006-12-08 07:59:33 +0100 |
commit | 5d03233c668b1235aaf5f919e72ca57e32f1be7b (patch) | |
tree | 70e78dd0389c105ba08e2484ac8a93f1651ad21f /feed.php | |
parent | 3a3e1c5fc9526f4f8e6706a4f0ec629e86ccc708 (diff) | |
download | rpg-5d03233c668b1235aaf5f919e72ca57e32f1be7b.tar.gz rpg-5d03233c668b1235aaf5f919e72ca57e32f1be7b.tar.bz2 |
fix feed links and cache
Fixed a double escaping error with & when no url rewriting was done.
Also made the feeds more responsive to changes in the wiki preferences.
darcs-hash:20061208065933-05dcb-a4a6f1aa7457c05eb75349a978bb7743c46b4c05.gz
Diffstat (limited to 'feed.php')
-rw-r--r-- | feed.php | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -54,13 +54,17 @@ // the feed is dynamic - we need a cache for each combo // (but most people just use the default feed so it's still effective) $cache = getCacheName($num.$type.$mode.$ns.$ltype.$_SERVER['REMOTE_USER'],'.feed'); + $cmod = @filemtime($cache); // 0 if not exists + if ($cmod && (@filemtime(DOKU_CONF.'local.php')>$cmod || @filemtime(DOKU_CONF.'dokuwiki.php')>$cmod)) { + // ignore cache if feed prefs may have changed + $cmod = 0; + } // check cacheage and deliver if nothing has changed since last // time or the update interval has not passed, also handles conditional requests header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); header('Pragma: public'); header('Content-Type: application/xml; charset=utf-8'); - $cmod = @filemtime($cache); // 0 if not exists if($cmod && (($cmod+$conf['rss_update']>time()) || ($cmod>@filemtime($conf['changelog'])))){ http_conditionalRequest($cmod); if($conf['allowdebug']) header("X-CacheUsed: $cache"); @@ -134,17 +138,17 @@ function rssRecentChanges(&$rss,$num,$ltype,$ns,$minor){ switch ($ltype){ case 'page': - $item->link = wl($recent['id'],'rev='.$recent['date'],true); + $item->link = wl($recent['id'],'rev='.$recent['date'],true,'&'); break; case 'rev': - $item->link = wl($recent['id'],'do=revisions&rev='.$recent['date'],true); + $item->link = wl($recent['id'],'do=revisions&rev='.$recent['date'],true,'&'); break; case 'current': - $item->link = wl($recent['id'], '', true); + $item->link = wl($recent['id'], '', true,'&'); break; case 'diff': default: - $item->link = wl($recent['id'],'rev='.$recent['date'].'&do=diff',true); + $item->link = wl($recent['id'],'rev='.$recent['date'].'&do=diff',true,'&'); } $item->description = $meta['description']['abstract']; @@ -201,7 +205,7 @@ function rssListNamespace(&$rss,$ns){ $item->title = $id; } - $item->link = wl($id,'rev='.$date,true); + $item->link = wl($id,'rev='.$date,true,'&'); $item->description = $meta['description']['abstract']; $item->date = date('r',$date); $rss->addItem($item); |