@@ -1437,14 +1437,13 @@ static void php_cli_server_request_dtor(php_cli_server_request *req) /* {{{ */
14371437 }
14381438} /* }}} */
14391439
1440- static void php_cli_server_request_translate_vpath (php_cli_server_request * request , const char * document_root , size_t document_root_len ) /* {{{ */
1440+ static void php_cli_server_request_translate_vpath (const php_cli_server * server , php_cli_server_request * request , const char * document_root , size_t document_root_len ) /* {{{ */
14411441{
14421442 zend_stat_t sb = {0 };
14431443 static const char * index_files [] = { "index.php" , "index.html" , NULL };
14441444 char * buf = safe_pemalloc (1 , request -> vpath_len , 1 + document_root_len + 1 + sizeof ("index.html" ), 1 );
14451445 char * p = buf , * prev_path = NULL , * q , * vpath ;
14461446 size_t prev_path_len = 0 ;
1447- int is_static_file = 0 ;
14481447
14491448 memmove (p , document_root , document_root_len );
14501449 p += document_root_len ;
@@ -1453,13 +1452,6 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
14531452 if (request -> vpath [0 ] != '/' ) {
14541453 * p ++ = DEFAULT_SLASH ;
14551454 }
1456- q = request -> vpath + request -> vpath_len ;
1457- while (q > request -> vpath ) {
1458- if (* q -- == '.' ) {
1459- is_static_file = 1 ;
1460- break ;
1461- }
1462- }
14631455 memmove (p , request -> vpath , request -> vpath_len );
14641456#ifdef PHP_WIN32
14651457 q = p + request -> vpath_len ;
@@ -1489,7 +1481,7 @@ static void php_cli_server_request_translate_vpath(php_cli_server_request *reque
14891481 }
14901482 file ++ ;
14911483 }
1492- if (!* file || is_static_file ) {
1484+ if (!* file ) {
14931485 if (prev_path ) {
14941486 pefree (prev_path , 1 );
14951487 }
@@ -1801,7 +1793,7 @@ static int php_cli_server_client_read_request_on_message_complete(php_http_parse
18011793{
18021794 php_cli_server_client * client = parser -> data ;
18031795 client -> request .protocol_version = parser -> http_major * 100 + parser -> http_minor ;
1804- php_cli_server_request_translate_vpath (& client -> request , client -> server -> document_root , client -> server -> document_root_len );
1796+ php_cli_server_request_translate_vpath (client -> server , & client -> request , client -> server -> document_root , client -> server -> document_root_len );
18051797 if (client -> request .vpath ) {
18061798 const char * vpath = client -> request .vpath ;
18071799 const char * end = vpath + client -> request .vpath_len ;
0 commit comments