diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-10 23:28:04 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2020-10-10 23:28:19 +0200 |
commit | 6494e578045f076f2d8a704951e9b7545a06de7d (patch) | |
tree | 7bc3856ea5d7be273ac7f05414acab8889bfd3ac /ext/imap/tests | |
parent | 7d085c87acb8ee2579cc27e8e51310741cb56c55 (diff) | |
parent | 7940fb42ce90173e285278b577e46cbab9b270a3 (diff) | |
download | php-git-6494e578045f076f2d8a704951e9b7545a06de7d.tar.gz |
Merge branch 'PHP-7.4' into PHP-8.0
* PHP-7.4:
Fix #80215: imap_mail_compose() may modify by-val parameters
Diffstat (limited to 'ext/imap/tests')
-rw-r--r-- | ext/imap/tests/bug80215.phpt | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/ext/imap/tests/bug80215.phpt b/ext/imap/tests/bug80215.phpt new file mode 100644 index 0000000000..b2d7c3ed09 --- /dev/null +++ b/ext/imap/tests/bug80215.phpt @@ -0,0 +1,69 @@ +--TEST-- +Bug #80215 (imap_mail_compose() may modify by-val parameters) +--SKIPIF-- +<?php +if (!extension_loaded('imap')) die('skip imap extension not available'); +?> +--FILE-- +<?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); +?> +--EXPECT-- +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) + } + } +} |