summaryrefslogtreecommitdiff
path: root/ext/standard/tests/mail
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-09-30 11:05:53 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-09-30 11:38:09 +0200
commite72165bb86aec6fc51dcb4d8d715e18be912ab67 (patch)
treed25485e05afa1c5baac23185458148c2478c04a8 /ext/standard/tests/mail
parent703c247c7d5da38651e9f5551ceecc1e6c1f8a13 (diff)
downloadphp-git-e72165bb86aec6fc51dcb4d8d715e18be912ab67.tar.gz
Fix #73203: passing additional_parameters causes mail to fail
We make sure that there's no unsigned underflow, which happened for `y==0`.
Diffstat (limited to 'ext/standard/tests/mail')
-rw-r--r--ext/standard/tests/mail/bug73203.phpt24
1 files changed, 24 insertions, 0 deletions
diff --git a/ext/standard/tests/mail/bug73203.phpt b/ext/standard/tests/mail/bug73203.phpt
new file mode 100644
index 0000000000..6b3bf6618c
--- /dev/null
+++ b/ext/standard/tests/mail/bug73203.phpt
@@ -0,0 +1,24 @@
+--TEST--
+Bug #73203 (passing additional_parameters causes mail to fail)
+--DESCRIPTION--
+We're not really interested in testing mail() here, but it is currently the
+only function besides mb_send_mail() which allows to call php_escape_shell_cmd()
+with an empty string. Therefore we don't check the resulting email, but only
+verify that the call succeeds.
+--INI--
+sendmail_path=cat >/dev/null
+mail.add_x_header = Off
+--SKIPIF--
+<?php
+if (substr(PHP_OS, 0, 3) === 'WIN') die('skip won\'t run on Windows');
+?>
+--FILE--
+<?php
+var_dump(
+ mail('test@example.com', 'subject', 'message', 'From: lala@example.com', '')
+);
+?>
+===DONE===
+--EXPECT--
+bool(true)
+===DONE===