|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
[2020-10-10 12:39 UTC] cmb@php.net
-Assigned To:
+Assigned To: cmb
[2020-10-10 15:31 UTC] cmb@php.net
[2020-10-10 21:29 UTC] cmb@php.net
[2020-10-10 21:29 UTC] cmb@php.net
-Status: Assigned
+Status: Closed
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 15:00:01 2025 UTC |
Description: ------------ imap_mail_compose() accepts two possibly nested arrays of strings, and due to type juggling, may actually convert the elements to string. Test script: --------------- <?php $envelope = [ "from" => 1, "to" => 2, "custom_headers" => [3], ]; $body = [[ "contents.data" => 4, "type.parameters" => ['foo' => 5], "disposition" => ['bar' => 6], ], [ "contents.data" => 7, "type.parameters" => ['foo' => 8], "disposition" => ['bar' => 9], ]]; imap_mail_compose($envelope, $body); var_dump($envelope, $body); ?> Expected result: ---------------- array(3) { ["from"]=> int(1) ["to"]=> int(2) ["custom_headers"]=> array(1) { [0]=> int(3) } } array(2) { [0]=> array(3) { ["contents.data"]=> int(4) ["type.parameters"]=> array(1) { ["foo"]=> int(5) } ["disposition"]=> array(1) { ["bar"]=> int(6) } } [1]=> array(3) { ["contents.data"]=> int(7) ["type.parameters"]=> array(1) { ["foo"]=> int(8) } ["disposition"]=> array(1) { ["bar"]=> int(9) } } } Actual result: -------------- array(3) { ["from"]=> string(1) "1" ["to"]=> string(1) "2" ["custom_headers"]=> array(1) { [0]=> string(1) "3" } } array(2) { [0]=> array(3) { ["contents.data"]=> string(1) "4" ["type.parameters"]=> array(1) { ["foo"]=> string(1) "5" } ["disposition"]=> array(1) { ["bar"]=> string(1) "6" } } [1]=> array(3) { ["contents.data"]=> string(1) "7" ["type.parameters"]=> array(1) { ["foo"]=> string(1) "8" } ["disposition"]=> array(1) { ["bar"]=> string(1) "9" } } }