From: x2003bruneau Date: Sun, 9 Jul 2006 19:04:58 +0000 (+0000) Subject: Fix cache issues X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=9d18c83847fc7c9a3f1bba5ee3007b08b6b91527;p=banana.git Fix cache issues git-svn-id: svn+ssh://murphy/home/svn/banana/trunk@71 9869982d-c50d-0410-be91-f2a2ec7c7c7b --- diff --git a/Changelog b/Changelog index ae50c29..bbfb9f2 100644 --- a/Changelog +++ b/Changelog @@ -3,6 +3,7 @@ Sun, 09 Jul 2006 Florent Bruneau * Can use a user-defined Array instead of $_GET * Bugfix: can remove all subscriptions * Bugfix: case sensitivity of newsgroup names + * Bugfix: correctly remove outdated cache entries Sat, 08 Jul 2006 Florent Bruneau diff --git a/banana/spool.inc.php b/banana/spool.inc.php index 7c70727..c7a7dae 100644 --- a/banana/spool.inc.php +++ b/banana/spool.inc.php @@ -104,18 +104,22 @@ class BananaSpool $this->_readFromFile(); $do_save = false; - $first = $banana->maxspool ? max($groupinfo[2]-$banana->maxspool, $groupinfo[1]) : $groupinfo[1]; - $last = $groupinfo[2]; - if ($this->version == BANANA_SPOOL_VERSION && is_array($this->overview)) { - if (count($this->overview)) { - for ($id = min(array_keys($this->overview)); $id<$first; $id++) { + $first = $banana->maxspool ? max($groupinfo[2] - $banana->maxspool, $groupinfo[1]) : $groupinfo[1]; + $last = $groupinfo[2]; + + if ($this->version == BANANA_SPOOL_VERSION && is_array($this->overview)) { + $mids = array_keys($this->overview); + foreach ($mids as $id) { + if (($first <= $last && ($id < $first || $id > $last)) + || ($first > $last && $id < $first && $id > $last)) + { $this->delid($id, false); $do_save = true; } } if (!empty($this->overview)) { $first = max(array_keys($this->overview))+1; - } + } } else { unset($this->overview, $this->ids); $this->version = BANANA_SPOOL_VERSION;