FAQ
Edit report at http://pear.php.net/bugs/bug.php?id=15888&edit=1

ID: 15888
Comment by: alec@alec.pl
Reported By: alec at alec dot pl
Summary: attachment name/filename header lacks semicolon
separator
Status: Verified
Type: Bug
Package: Mail_Mime
PHP Version: 5.2.8
Roadmap Versions:
New Comment:

test script for this bug:
--TEST--
Bug #15888 Semicolon separator for (Content-Type/Content-Disposition)
header parts
--SKIPIF--
--FILE--
<?php
error_reporting(E_ALL); // ignore E_STRICT
include('Mail/mime.php');
$filename = 'long name with spaces, very very very very long long long
long.txt';
$mimepart = new Mail_mimePart('');
echo $mimepart->_buildHeaderParam('filename', $filename, 'UTF-8');
?>
--EXPECT--
filename*0*=UTF-8''long%20name%20with%20spaces,%20very%20very%20very%20very;
filename*1*=%20long%20long%20long%20long.txt;


Previous Comments:
------------------------------------------------------------------------

[2009-08-25 10:00:32] cweiske

-Status: Feedback
+Status: Verified


------------------------------------------------------------------------

[2009-08-25 10:00:23] cweiske

http://trac.roundcube.net/ticket/1485727
http://groups.google.com/group/opera.mail+news/browse_thread/thread/af353c9052ce59ed

You are right. The standard says that distinct parts of an header need
to be separated by a semicolon. Since filename*0* and filename*1* are
different parts, even if they belong together, they need to have
semicolons between them.

------------------------------------------------------------------------

[2009-08-25 09:55:32] cweiske

Sylpheed does not use filename*x* at all:

--Multipart=_Tue__25_Aug_2009_09_54_22_+0200_+xAiUIxEQre8wtG5
Content-Type: text/plain;
name="das hier ist ein sehr langer dateiname - und zwar so lang, dass
er nicht in eine zeile beim mime-zeug passt. was machen wir also hier
fragezeichen - einfach nichts, oder doch etwas fragezeichen.txt"
Content-Disposition: attachment;
filename="das hier ist ein sehr langer dateiname - und zwar so lang,
dass
er nicht in eine zeile beim mime-zeug passt. was machen wir also hier
fragezeichen - einfach nichts, oder doch etwas fragezeichen.txt"
Content-Transfer-Encoding: 7bit

------------------------------------------------------------------------

[2009-08-25 09:43:09] alec

Also my bulk patch in #12411 addresses this issue.

------------------------------------------------------------------------

[2009-08-25 09:41:00] alec

<?php

include('Mail/mime.php');

$filename = 'long name with spaces, very long long long long.txt';

$mimepart = new Mail_mimePart('');

echo $mimepart->_buildHeaderParam('filename', $filename, 'UTF-8');

?>

------------------------------------------------------------------------

The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://pear.php.net/bugs/bug.php?id=15888

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
grouppear-bugs @
categoriesphp
postedNov 26, '09 at 9:51a
activeNov 26, '09 at 9:51a
posts1
users1
websitepear.php.net

1 user in discussion

Alec: 1 post

People

Translate

site design / logo © 2022 Grokbase