From a07f7545e53930d0a4e51a5d9022f72aa9383d14 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Thu, 16 Apr 2009 19:28:02 -0600 Subject: [PATCH] Send some data as intvals. Ensures we don't need to add unneeded quotes during JSON encode. --- imp/ajax.php | 4 ++-- imp/lib/DIMP.php | 2 +- imp/lib/Views/ListMessages.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/imp/ajax.php b/imp/ajax.php index 17ec6fed3..d248f0ba8 100644 --- a/imp/ajax.php +++ b/imp/ajax.php @@ -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, ); diff --git a/imp/lib/DIMP.php b/imp/lib/DIMP.php index a2c74a0ce..6b849422d 100644 --- a/imp/lib/DIMP.php +++ b/imp/lib/DIMP.php @@ -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']) { diff --git a/imp/lib/Views/ListMessages.php b/imp/lib/Views/ListMessages.php index 4eab9b4b0..4127fec62 100644 --- a/imp/lib/Views/ListMessages.php +++ b/imp/lib/Views/ListMessages.php @@ -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'], ); -- 2.11.0