Send some data as intvals.
authorMichael M Slusarz <slusarz@curecanti.org>
Fri, 17 Apr 2009 01:28:02 +0000 (19:28 -0600)
committerMichael M Slusarz <slusarz@curecanti.org>
Fri, 17 Apr 2009 06:05:54 +0000 (00:05 -0600)
Ensures we don't need to add unneeded quotes during JSON encode.

imp/ajax.php
imp/lib/DIMP.php
imp/lib/Views/ListMessages.php

index 17ec6fe..d248f0b 100644 (file)
@@ -304,7 +304,7 @@ case 'Poll':
     $result->poll = array();
     foreach ($imptree->getPollList(true) as $val) {
         if ($info = $imptree->getElementInfo($val)) {
-            $result->poll[$val] = $info['unseen'];
+            $result->poll[$val] = intval($info['unseen']);
         }
     }
 
@@ -471,7 +471,7 @@ case 'ShowPreview':
     $ptr = each($indices);
     $args = array(
         'folder' => $ptr['key'],
-        'index' => reset($ptr['value']),
+        'index' => intval(reset($ptr['value'])),
         'preview' => true,
     );
 
index a2c74a0..6b84942 100644 (file)
@@ -416,7 +416,7 @@ class DIMP
             $ob->cl = 'exp';
         } else {
             if ($elt['polled']) {
-                $ob->u = $elt['unseen'];
+                $ob->u = intval($elt['unseen']);
             }
 
             switch ($elt['special']) {
index 4eab9b4..4127fec 100644 (file)
@@ -251,7 +251,7 @@ class IMP_Views_ListMessages
             $msg = array(
                 'imapuid' => intval($ob['uid']),
                 'menutype' => 'message',
-                'rownum' => $ob['seq'],
+                'rownum' => intval($ob['seq']),
                 'view' => $ob['mailbox'],
             );