Permalink
Browse files

fixed media only RSS feed

when the SKIP_DELETED flag was set, no recent changes where returned for
media only queries, becuase file checks where done on page files instead
of media files
  • Loading branch information...
1 parent 361171a commit 1d901ab2e0bb93fd121685d355782e3672c0d96d @splitbrain splitbrain committed Mar 2, 2012
Showing with 7 additions and 5 deletions.
  1. +7 −5 inc/changelog.php
View
@@ -188,7 +188,7 @@ function getRecents($first,$num,$ns='',$flags=0){
// handle lines
while ($lines_position >= 0 || (($flags & RECENTS_MEDIA_PAGES_MIXED) && $media_lines_position >=0)) {
if (empty($rec) && $lines_position >= 0) {
- $rec = _handleRecent(@$lines[$lines_position], $ns, $flags & ~RECENTS_MEDIA_CHANGES, $seen);
+ $rec = _handleRecent(@$lines[$lines_position], $ns, $flags, $seen);
if (!$rec) {
$lines_position --;
continue;
@@ -197,8 +197,8 @@ function getRecents($first,$num,$ns='',$flags=0){
if (($flags & RECENTS_MEDIA_PAGES_MIXED) && empty($media_rec) && $media_lines_position >= 0) {
$media_rec = _handleRecent(@$media_lines[$media_lines_position], $ns, $flags | RECENTS_MEDIA_CHANGES, $seen);
if (!$media_rec) {
- $media_lines_position --;
- continue;
+ $media_lines_position --;
+ continue;
}
}
if (($flags & RECENTS_MEDIA_PAGES_MIXED) && @$media_rec['date'] >= @$rec['date']) {
@@ -320,8 +320,10 @@ function _handleRecent($line,$ns,$flags,&$seen){
if ($recent['perms'] < AUTH_READ) return false;
// check existance
- $fn = (($flags & RECENTS_MEDIA_CHANGES) ? mediaFN($recent['id']) : wikiFN($recent['id']));
- if((!@file_exists($fn)) && ($flags & RECENTS_SKIP_DELETED)) return false;
+ if($flags & RECENTS_SKIP_DELETED){
+ $fn = (($flags & RECENTS_MEDIA_CHANGES) ? mediaFN($recent['id']) : wikiFN($recent['id']));
+ if(!@file_exists($fn)) return false;
+ }
return $recent;
}

0 comments on commit 1d901ab

Please sign in to comment.