stats.php: fix bug in detail-purging heuristic