Ooops: wrong use of preg_split.
[banana.git] / banana / banana.inc.php.in
index 26cb3a5..80b07ff 100644 (file)
@@ -37,6 +37,10 @@ class Banana
     static public $spool_tmax    = 10;
     static public $spool_boxlist = true;
 
+### Tree options ###
+    static public $tree_read  = 'dg';
+    static public $tree_unread = 'b';
+
 ### Message processing ###
     static public $msgparse_headers = array('content-disposition', 'content-transfer-encoding',
                                        'content-type', 'content-id', 'date', 'followup-to',
@@ -505,7 +509,7 @@ class Banana
                     $hdr_values[$header] = utf8_encode($hdr_values[$header]);
                 }
             }
-            $values = split('[,; ]', $hdr_values[$hdrs['dest']]);
+            $values = preg_split('/[,; ]/', $hdr_values[$hdrs['dest']]);
             $hdr_values[$hdrs['dest']] = preg_replace('/,+/', ',', implode(',', $values));
             if (!is_null($artid)) {
                 $old =& $this->loadMessage($group, $artid);
@@ -673,26 +677,7 @@ class Banana
     {
         Banana::load('spool');
         if (!Banana::$spool || Banana::$spool->group != $group) {
-            $clean = false;
-            if (php_sapi_name() != 'cli') {
-                if ($group == @$_SESSION['banana_group'] && isset($_SESSION['banana_spool'])) {
-                    Banana::$spool = unserialize($_SESSION['banana_spool']);
-                    unset($_SESSION['banana_spool']);
-                    $clean = @(Banana::$profile['lastnews'] != $_SESSION['banana_lastnews']);
-                } else {
-                    unset($_SESSION['banana_message']);
-                    unset($_SESSION['banana_artid']);
-                    unset($_SESSION['banana_showhdr']);
-                }
-            }
-            BananaSpool::getSpool($group, Banana::$profile['lastnews'], Banana::$profile['autoup'] || $clean);
-            if (php_sapi_name() != 'cli') {
-                $_SESSION['banana_group'] = $group;
-                if (!Banana::$profile['display']) {
-                    $_SESSION['banana_spool'] = serialize(Banana::$spool);
-                    $_SESSION['banana_lastnews'] = Banana::$profile['lastnews'];
-                }
-            }
+            BananaSpool::getSpool($group, Banana::$profile['lastnews'], Banana::$profile['autoup']);
             Banana::$spool->setMode(Banana::$profile['display'] ? Banana::SPOOL_UNREAD : Banana::SPOOL_ALL);
         }
         return true;