Bug #66117 [NEW]: CentOS release 6.2 (Final)
| From: | saygushkin at gmail dot com | Date: | Tue, 19 Nov 2013 13:01:14 +0000 |
| Subject: | Bug #66117 [NEW]: CentOS release 6.2 (Final) | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-182823@lists.php.net to get a copy of this message | ||
From: saygushkin at gmail dot com
Operating system: Linux
PHP version: 5.4.22
Package: IMAP related
Bug Type: Bug
Bug description:CentOS release 6.2 (Final)
Description:
------------
---
From manual page:
http://www.php.net/function.imap-fetchstructure#refsect1-function.imap-fetchstructure-returnvalues
---
I attached to the mail of the file with name "пÑÑÑой
Ñайл.txt".
Filename in dparameters->value is incomplete.
Mail source code:
--------------030200090909050404050001
Content-Type: text/plain; charset="UTF-8";
name="=?UTF-8?B?0L/Rg9GB0YLQvtC5INGE0LDQudC7LnR4dA==?="
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename*0*="UTF-8''%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0";
filename*1*="%B9%D0%BB%2E%74%78%74"
0L/Rg9GB0YLQvtC5INGE0LDQudC7Cg==
--------------030200090909050404050001--
Test script:
---------------
$imapStream = imap_open($imapPath, $login, $password);
$mailIds = imap_search($imapStream, 'ALL', SE_UID);
$mailId = array_shift(mailIds);
$mailStructure = imap_fetchstructure($imapStream, $mailId, FT_UID);
var_dump($mailStructure);
var_dump($mailStructure->parts[1]->dparameters[0]->value);
var_dump(urldecode('%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0'));
Expected result:
----------------
["dparameters"]=>
array(1) {
[0]=>
object(stdClass)#724 (2) {
["attribute"]=>
string(8) "filename"
["value"]=>
string(61)
"UTF-8''%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0"
}
}
["ifparameters"]=>
int(1)
["parameters"]=>
array(2) {
[0]=>
object(stdClass)#725 (2) {
["attribute"]=>
string(7) "charset"
["value"]=>
string(5) "UTF-8"
}
[1]=>
object(stdClass)#726 (2) {
["attribute"]=>
string(4) "name"
["value"]=>
string(48) "=?UTF-8?B?0L/Rg9GB0YLQvtC5INGE0LDQudC7LnR4dA==?="
}
}
string(61)
"UTF-8''%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0"
string(18) "пÑÑÑой Ñа�"
Actual result:
--------------
["dparameters"]=>
array(1) {
[0]=>
object(stdClass)#724 (2) {
["attribute"]=>
string(8) "filename"
["value"]=>
string(61)
"UTF-8''%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0%B9%D0%BB%2E%74%78%74"
}
}
["ifparameters"]=>
int(1)
["parameters"]=>
array(2) {
[0]=>
object(stdClass)#725 (2) {
["attribute"]=>
string(7) "charset"
["value"]=>
string(5) "UTF-8"
}
[1]=>
object(stdClass)#726 (2) {
["attribute"]=>
string(4) "name"
["value"]=>
string(48) "=?UTF-8?B?0L/Rg9GB0YLQvtC5INGE0LDQudC7LnR4dA==?="
}
}
string(61)
"UTF-8''%D0%BF%D1%83%D1%81%D1%82%D0%BE%D0%B9%20%D1%84%D0%B0%D0%B9%D0%BB%2E%74%78%74"
string(25) "пÑÑÑой Ñайл.txt"
--
Edit bug report at https://bugs.php.net/bug.php?id=66117&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=66117&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=66117&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=66117&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=66117&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=66117&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=66117&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=66117&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=66117&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=66117&r=support
Expected behavior: https://bugs.php.net/fix.php?id=66117&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=66117&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=66117&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=66117&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=66117&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=66117&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=66117&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=66117&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=66117&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=66117&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=66117&r=mysqlcfg