summaryrefslogtreecommitdiff
path: root/inc/changelog.php
diff options
context:
space:
mode:
authorchris <chris@jalakai.co.uk>2006-09-24 01:51:09 +0200
committerchris <chris@jalakai.co.uk>2006-09-24 01:51:09 +0200
commit40b33eff69a8a44da0ab6962d50f2027bcfc33b6 (patch)
tree22d35a8651cd42093b0a55670b28528eac2bf3b5 /inc/changelog.php
parent44a35da6ab4b9a02117df84a2208a57b8f339ee6 (diff)
downloadrpg-40b33eff69a8a44da0ab6962d50f2027bcfc33b6.tar.gz
rpg-40b33eff69a8a44da0ab6962d50f2027bcfc33b6.tar.bz2
fix recent changes cache ordering
This patch fixes a bug in indexer.php which resulted in the order of the recent changes cache being reversed each time it was trimmed. It also adds sorting to both getRecents() and runTrimRecentChanges() as a defensive measure against the order of the file being corrupted. darcs-hash:20060923235109-9b6ab-0f4062c1b02449cce9382426174cd22d71387e5a.gz
Diffstat (limited to 'inc/changelog.php')
-rw-r--r--inc/changelog.php3
1 files changed, 2 insertions, 1 deletions
diff --git a/inc/changelog.php b/inc/changelog.php
index fdb18253c..9501ec392 100644
--- a/inc/changelog.php
+++ b/inc/changelog.php
@@ -111,13 +111,14 @@ function getRecents($first,$num,$ns='',$flags=0){
$rec = _handleRecent($lines[$i], $ns, $flags);
if($rec !== false) {
if(--$first >= 0) continue; // skip first entries
- $recent[] = $rec;
+ $recent[$rec['date']] = $rec;
$count++;
// break when we have enough entries
if($count >= $num){ break; }
}
}
+ krsort($recent);
return $recent;
}