diff options
author | Lior Kaplan <kaplanlior@gmail.com> | 2013-10-18 22:57:51 +0300 |
---|---|---|
committer | Lior Kaplan <kaplanlior@gmail.com> | 2013-10-19 15:52:26 +0300 |
commit | 3f2474550cbf299d8a7df34988ece052a0401414 (patch) | |
tree | c31805aa899ff4bd51981781b1d1d79a6540e245 /sapi | |
parent | 1fd24dd3e14010b82febd3e300599f8d8f9c592c (diff) | |
download | php-3f2474550cbf299d8a7df34988ece052a0401414.tar.gz |
Imported Upstream version 5.5.5+dfsg
Diffstat (limited to 'sapi')
-rw-r--r-- | sapi/cli/php_cli_server.c | 2 | ||||
-rw-r--r-- | sapi/cli/tests/cli_process_title_windows.phpt | 7 |
2 files changed, 6 insertions, 3 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index d50cc4f8a..1315a62b8 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -268,6 +268,7 @@ static php_cli_server_ext_mime_type_pair mime_type_map[] = { { "jpg", "image/jpeg" }, { "jpeg", "image/jpeg" }, { "jpe", "image/jpeg" }, + { "pdf", "application/pdf" }, { "png", "image/png" }, { "svg", "image/svg+xml" }, { "txt", "text/plain" }, @@ -1599,6 +1600,7 @@ static int php_cli_server_client_read_request_on_body(php_http_parser *parser, c } client->request.content_len = 0; } + client->request.content = perealloc(client->request.content, client->request.content_len + length, 1); memmove(client->request.content + client->request.content_len, at, length); client->request.content_len += length; return 0; diff --git a/sapi/cli/tests/cli_process_title_windows.phpt b/sapi/cli/tests/cli_process_title_windows.phpt index 309c09c0e..472f9c10f 100644 --- a/sapi/cli/tests/cli_process_title_windows.phpt +++ b/sapi/cli/tests/cli_process_title_windows.phpt @@ -20,7 +20,7 @@ if (strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') // no warnings/errors. $is_windows8 = false; -$ps_output = shell_exec("PowerShell \"(Get-Host).UI.RawUI.WindowTitle\""); +$ps_output = shell_exec("PowerShell -NoProfile \"(Get-Host).UI.RawUI.WindowTitle\""); if ($ps_output === null) { echo "Get-Host failed\n"; @@ -28,7 +28,8 @@ if ($ps_output === null) } $ps_output = trim($ps_output); -if (($ps_output == "Windows PowerShell") || ($ps_output == "Administrator: Windows PowerShell")) +$end_title_windows8 = ": Windows PowerShell"; +if (($ps_output == "Windows PowerShell") || (strlen($ps_output) > strlen($end_title_windows8) && substr($ps_output,-strlen($end_title_windows8)) === $end_title_windows8)) $is_windows8 = true; echo "*** Testing setting the process title ***\n"; @@ -45,7 +46,7 @@ if ($is_windows8) } else { - $loaded_title = shell_exec("PowerShell \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); + $loaded_title = shell_exec("PowerShell -NoProfile \"get-process cmd*,powershell* | Select-Object mainWindowTitle | ft -hide\""); if ($loaded_title === null) { |