Re: [SM-DEVEL] broken attachments with multiple attachments and php 4.3.11
- To: "Roalt Zijlstra" <roalt@kwenie.org>
- Cc: debian-devel@lists.debian.org
- Subject: Re: [SM-DEVEL] broken attachments with multiple attachments and php 4.3.11
- From: "Thijs Kinkhorst" <kink@squirrelmail.org>
- Date: Fri, 3 Jun 2005 11:46:21 +0200 (CEST)
- Message-id: <[🔎] 1492.143.121.153.52.1117791981.squirrel@wm.kinkhorst.nl>
- In-reply-to: <32978.212.238.154.132.1117791459.squirrel@mail.kwenie.org>
- References: <32912.10.5.5.14.1115756361.squirrel@webmail.kwenie.org> <200506011754.27262.thomas.morper@rz.uni-augsburg.de> <32811.10.5.5.14.1117651774.squirrel@webmail.kwenie.org> <1167.143.121.153.52.1117703433.squirrel@wm.kinkhorst.nl> <32978.212.238.154.132.1117791459.squirrel@mail.kwenie.org>
Hello Roalt,
On Fri, June 3, 2005 11:37, Roalt Zijlstra wrote:
> I think I have fix for this silly PHP 4.3.11 bug and the fix is even more
> trivial. I can't imagine this will break anything.
Thanks! It looks indeed ok, I'll mail it to the -devel list to get some
more eyes on it, and will commit it shortly unless concerns arise. I think
it will go into the 1.4.5 release.
Unfortunately this can't get into Debian anymore (so that will have the
bad PHP-version and the not-worked-around SquirrelMail version) because
Sarge will be released on Monday.
Thijs
> Here is the patch:
> --- Deliver.class.php.orig 2005-06-03 11:21:38.000000000 +0200
> +++ Deliver.class.php 2005-06-03 11:16:34.000000000 +0200
> @@ -168,6 +168,11 @@
> $encoded = '';
> while ($tmp = fread($file, 570)) {
> $body_part = chunk_split(base64_encode($tmp));
> + /* Up to 4.3.10 chunk_split always appends a newline,
> while in 4.3.11 it doesn't if
> + * the string to split is shorter than the chunk
> length.
> + */
> + if( substr($body_part, -1 , 1 ) != "\n" )
> + $body_part .= "\n";
> $length += $this->clean_crlf($body_part);
> if ($stream) {
> $this->writeToStream($stream, $body_part);
>
> Sweet and simple and works for all PHP versions which were backpatched
> like
> the Debian PHP 4.3.10.
>
> Greetings,
>
> Roalt
> --
> Project-Based Calendar System
> http://www.pbcs.org
> roalt@pbcs.org
> roalt@kwenie.org
> zijlstra@stone-it.com (Work)
>
>
Reply to: