From 257dea3f99526f1efb22e4ebfec2719ca50bacac Mon Sep 17 00:00:00 2001 From: stekkel Date: Wed, 27 Apr 2005 17:04:00 +0000 Subject: [PATCH] More possible NUL character problems solved. git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@9398 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- class/deliver/Deliver.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/class/deliver/Deliver.class.php b/class/deliver/Deliver.class.php index 81ba38b6..c732bea5 100644 --- a/class/deliver/Deliver.class.php +++ b/class/deliver/Deliver.class.php @@ -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); -- 2.25.1