summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS5
-rw-r--r--ext/standard/exec.c4
-rw-r--r--ext/standard/mail.c4
-rw-r--r--ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt2
-rw-r--r--ext/standard/tests/general_functions/escapeshellcmd-win32.phpt5
-rw-r--r--ext/standard/tests/mail/bug69874_2.phpt43
-rw-r--r--sapi/litespeed/lsapi_main.c2
7 files changed, 60 insertions, 5 deletions
diff --git a/NEWS b/NEWS
index 7f1bf5d732..6e006a4801 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,11 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2015 PHP 5.4.43
+- Core:
+ . Fixed bug #69768 (escapeshell*() doesn't cater to !). (cmb)
+ . Fixed bug #69874 (Can't set empty additional_headers for mail()), regression
+ from fix to bug #68776. (Yasuo)
+
11 Jun 2015 PHP 5.4.42
- Core:
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index d0b1e01e16..aa487351ca 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -281,9 +281,10 @@ PHPAPI char *php_escape_shell_cmd(char *str)
break;
#else
/* % is Windows specific for enviromental variables, ^%PATH% will
- output PATH whil ^%PATH^% not. escapeshellcmd will escape all %.
+ output PATH while ^%PATH^% will not. escapeshellcmd will escape all % and !.
*/
case '%':
+ case '!':
case '"':
case '\'':
#endif
@@ -366,6 +367,7 @@ PHPAPI char *php_escape_shell_arg(char *str)
#ifdef PHP_WIN32
case '"':
case '%':
+ case '!':
cmd[y++] = ' ';
break;
#else
diff --git a/ext/standard/mail.c b/ext/standard/mail.c
index aa29a22c85..75bd423f8d 100644
--- a/ext/standard/mail.c
+++ b/ext/standard/mail.c
@@ -312,7 +312,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
php_basename(tmp, strlen(tmp), NULL, 0,&f, &f_len TSRMLS_CC);
- if (headers != NULL) {
+ if (headers != NULL && *headers) {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s\n%s", php_getuid(TSRMLS_C), f, headers);
} else {
spprintf(&hdr, 0, "X-PHP-Originating-Script: %ld:%s", php_getuid(TSRMLS_C), f);
@@ -420,7 +420,7 @@ PHPAPI int php_mail(char *to, char *subject, char *message, char *headers, char
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not execute mail delivery program '%s'", sendmail_path);
#if PHP_SIGCHILD
if (sig_handler) {
- signal(SIGCHLD, sig_handler);
+ signal(SIGCHLD, sig_handler);
}
#endif
MAIL_RET(0);
diff --git a/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt b/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt
index 888005633d..d97c1a956b 100644
--- a/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt
+++ b/ext/standard/tests/general_functions/escapeshellarg_basic-win32.phpt
@@ -18,6 +18,7 @@ echo "Simple testcase for escapeshellarg() function\n";
var_dump(escapeshellarg("Mr O'Neil"));
var_dump(escapeshellarg("Mr O\'Neil"));
var_dump(escapeshellarg("%FILENAME"));
+var_dump(escapeshellarg("!FILENAME"));
var_dump(escapeshellarg(""));
echo "Done\n";
@@ -27,5 +28,6 @@ Simple testcase for escapeshellarg() function
string(11) ""Mr O'Neil""
string(12) ""Mr O\'Neil""
string(11) "" FILENAME""
+string(11) "" FILENAME""
string(2) """"
Done \ No newline at end of file
diff --git a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
index 9fcb99188c..7d2a029b47 100644
--- a/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
+++ b/ext/standard/tests/general_functions/escapeshellcmd-win32.phpt
@@ -17,7 +17,8 @@ $data = array(
'%^',
'#&;`|*?',
'~<>\\',
- '%NOENV%'
+ '%NOENV%',
+ '!NOENV!'
);
$count = 1;
@@ -46,4 +47,6 @@ string(14) "^#^&^;^`^|^*^?"
string(8) "^~^<^>^\"
-- Test 8 --
string(9) "^%NOENV^%"
+-- Test 9 --
+string(9) "^!NOENV^!"
Done
diff --git a/ext/standard/tests/mail/bug69874_2.phpt b/ext/standard/tests/mail/bug69874_2.phpt
new file mode 100644
index 0000000000..53d991a26b
--- /dev/null
+++ b/ext/standard/tests/mail/bug69874_2.phpt
@@ -0,0 +1,43 @@
+--TEST--
+Bug #69874: Null addtional_headers does not send mail
+--INI--
+sendmail_path=tee mailBasic.out >/dev/null
+mail.add_x_header = On
+--SKIPIF--
+<?php
+if(substr(PHP_OS, 0, 3) == "WIN")
+ die("skip Won't run on Windows");
+?>
+--FILE--
+<?php
+/* Prototype : int mail(string to, string subject, string message [, string additional_headers [, string additional_parameters]])
+ * Description: Send an email message
+ * Source code: ext/standard/mail.c
+ * Alias to functions:
+ */
+
+echo "*** Testing mail() : send email without additional headers ***\n";
+
+// Initialise all required variables
+$to = 'user@company.com';
+$subject = 'Test Subject';
+$message = 'A Message';
+
+$outFile = "mailBasic.out";
+@unlink($outFile);
+
+var_dump( mail($to, $subject, $message, '') );
+echo file_get_contents($outFile);
+unlink($outFile);
+
+?>
+===DONE===
+--EXPECTF--
+*** Testing mail() : send email without additional headers ***
+bool(true)
+To: user@company.com
+Subject: Test Subject
+X-PHP-Originating-Script: %d:bug69874_2.php
+
+A Message
+===DONE===
diff --git a/sapi/litespeed/lsapi_main.c b/sapi/litespeed/lsapi_main.c
index 458a82e660..f1441392ff 100644
--- a/sapi/litespeed/lsapi_main.c
+++ b/sapi/litespeed/lsapi_main.c
@@ -427,7 +427,7 @@ static void sapi_lsapi_log_message(char *message TSRMLS_DC)
static sapi_module_struct lsapi_sapi_module =
{
"litespeed",
- "LiteSpeed V6.7",
+ "LiteSpeed V6.8",
php_lsapi_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */