diff options
author | Jakub Zelenka <bukka@php.net> | 2016-02-29 19:28:40 +0000 |
---|---|---|
committer | Jakub Zelenka <bukka@php.net> | 2016-02-29 19:28:40 +0000 |
commit | 80015ba741fc857074050086db6c7b2a4716d6d5 (patch) | |
tree | 9e0b85868c092ae83a0df2bd4f33f79ba773aab2 /sapi/cli/php_cli_server.c | |
parent | 4ea2a0fd60cdf75d746909198ea69f1e3e4ba193 (diff) | |
parent | 31dc08a904f2a91b582396b6ba118abfd12cf246 (diff) | |
download | php-git-80015ba741fc857074050086db6c7b2a4716d6d5.tar.gz |
Merge branch 'PHP-7.0' into openssl_error_store
Diffstat (limited to 'sapi/cli/php_cli_server.c')
-rw-r--r-- | sapi/cli/php_cli_server.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index 4ee85bf538..ac41c44def 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -1955,6 +1955,19 @@ static int php_cli_server_begin_send_static(php_cli_server *server, php_cli_serv return php_cli_server_send_error_page(server, client, 400); } +#ifdef PHP_WIN32 + /* The win32 namespace will cut off trailing dots and spaces. Since the + VCWD functionality isn't used here, a sophisticated functionality + would have to be reimplemented to know ahead there are no files + with invalid names there. The simplest is just to forbid invalid + filenames, which is done here. */ + if (client->request.path_translated && + ('.' == client->request.path_translated[client->request.path_translated_len-1] || + ' ' == client->request.path_translated[client->request.path_translated_len-1])) { + return php_cli_server_send_error_page(server, client, 500); + } +#endif + fd = client->request.path_translated ? open(client->request.path_translated, O_RDONLY): -1; if (fd < 0) { return php_cli_server_send_error_page(server, client, 404); |