[dev] Quota 'NO LIMIT' Bug - reopen?
Leena Heino
Leena.Heino@uta.fi
Wed Nov 20 12:28:08 2002
On Wed, 20 Nov 2002, Mike Cochrane wrote:
> That is not correct.
> If the user has a quota set, but no mail or folders then the imap_get_quota
> returns false.
>
> This is easily demonstrated with a new account. Send it an email so
> there is one in the inbox and it all works fine. Delete that email and
> purge it and imap_get_quota starts returning false again.
There is something very wrong with imap_get_quota(). It seems that in some
situations (at least with php-4.2.3) it may actually return wrong quota
information. Wrong in the meaning of that the information seems to be old
or erraneous or something that existed when previous call to
imap_get_quota was made from php.
When I try to debug the situation with telneting to imap server imap port
then everything works as it should be. But if I try to use imap_get_quota
function then it might work or I might get seemingly random results.
Anyway back to the issue with the imp/lib/Quota.php file. It seems
that the if should be: if ("$used" !== "")
Here's the patch:
--- imp/lib/Quota.php.orig Mon Aug 5 09:04:10 2002
+++ imp/lib/Quota.php Wed Nov 20 11:52:45 2002
@@ -110,7 +110,7 @@
*/
function _quotaHtml($used, $total)
{
- if (!empty($used) && !empty($total)) {
+ if ("$used" !== "") {
$used = $used / (1024 * 1024.0);
$total = $total / (1024 * 1024.0);
$percent = ($used * 100) / $total;
>
> - Mike :-)
>
--
-- Leena Heino (liinu at uta.fi)
More information about the dev
mailing list