Should compared strings with strings. Otherwise a string of just '0' is treated...
authorindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 29 Oct 2004 18:15:59 +0000 (18:15 +0000)
committerindiri69 <indiri69@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 29 Oct 2004 18:15:59 +0000 (18:15 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@8276 7612ce4b-ef26-0410-bec9-ea0150e637f0

ChangeLog
functions/imap_general.php

index 37332a36b96d1a3f083bd02bada146cc849f6844..9cc82fb467afb77c8075e92c352faa08d5ec4fce 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -136,6 +136,8 @@ Version 1.5.1 -- CVS
   - Added site configuration and custom translation engine support to translate 
     plugin.
   - Fixed SquirrelSpell error output.  Patch courtesy David Boone.
+  - Fixed bug in IMAP read routines that treated "0" as false instead of
+    a string (patch courtesy Maurice Makaay).
 
 Version 1.5.0
 --------------------
index 3f6c284a15ae3ce726bbe80ed3b76a3913a3b780..f3c1ffaa28ac7610797b59f50acda6aca67a02e4 100755 (executable)
@@ -219,20 +219,20 @@ function sqimap_fread($imap_stream,$iSize,$filter=false,
         if ($iRemaining < $iBufferSize) {
             $iBufferSize = $iRemaining;
         }
-        if (!$sRead) {
+        if ($sRead == '') {
             $results = false;
             break;
         }
-        if ($sReadRem) {
+        if ($sReadRem != '') {
             $sRead = $sReadRem . $sRead;
             $sReadRem = '';
         }
 
-        if ($filter && $sRead) {
+        if ($filter && $sRead != '') {
            // in case the filter is base64 decoding we return a remainder
            $sReadRem = $filter($sRead);
         }
-        if ($outputstream && $sRead) {
+        if ($outputstream && $sRead != '') {
            if (is_resource($outputstream)) {
                fwrite($outputstream,$sRead);
            } else if ($outputstream == 'php://stdout') {
@@ -989,4 +989,4 @@ function map_yp_alias($username) {
    return chop(substr($yp, strlen($username)+1));
 }
 
-?>
\ No newline at end of file
+?>