From 40b33eff69a8a44da0ab6962d50f2027bcfc33b6 Mon Sep 17 00:00:00 2001 From: chris Date: Sun, 24 Sep 2006 01:51:09 +0200 Subject: 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 --- inc/changelog.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'inc/changelog.php') 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; } -- cgit v1.2.3