More possible NUL character problems solved.
authorstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 27 Apr 2005 17:04:00 +0000 (17:04 +0000)
committerstekkel <stekkel@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 27 Apr 2005 17:04:00 +0000 (17:04 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9398 7612ce4b-ef26-0410-bec9-ea0150e637f0

class/deliver/Deliver.class.php

index 81ba38b6311e9c8495485b0b73237e70d73a03af..c732bea5669204fe60c18b76c2eae50ffcb099fb 100644 (file)
@@ -154,6 +154,8 @@ class Deliver {
                 $filename = $message->att_local_name;
                 $file = fopen ($filename, 'rb');
                 while ($body_part = fgets($file, 4096)) {
+                    // remove NUL characters
+                    $body_part = str_replace("\0",'',$body_part);
                     $length += $this->clean_crlf($body_part);
                     if ($stream) {
                         $this->preWriteToStream($body_part);
@@ -167,6 +169,8 @@ class Deliver {
         default:
             if ($message->body_part) {
                 $body_part = $message->body_part;
+                // remove NUL characters
+                $body_part = str_replace("\0",'',$body_part);
                 $length += $this->clean_crlf($body_part);
                 if ($stream) {
                     $this->writeToStream($stream, $body_part);