Skip to content

Commit c27368c

Browse files
committed
cli: Use zend_hash_str_find_ptr_lc() in get_mime_type()
1 parent 50131de commit c27368c

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

sapi/cli/php_cli_server.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,7 @@ static void append_essential_headers(smart_str* buffer, php_cli_server_client *c
395395

396396
static const char *get_mime_type(const php_cli_server *server, const char *ext, size_t ext_len) /* {{{ */
397397
{
398-
char *ret;
399-
ALLOCA_FLAG(use_heap)
400-
char *ext_lower = do_alloca(ext_len + 1, use_heap);
401-
zend_str_tolower_copy(ext_lower, ext, ext_len);
402-
ret = zend_hash_str_find_ptr(&server->extension_mime_types, ext_lower, ext_len);
403-
free_alloca(ext_lower, use_heap);
404-
return (const char*)ret;
398+
return zend_hash_str_find_ptr_lc(&server->extension_mime_types, ext, ext_len);
405399
} /* }}} */
406400

407401
PHP_FUNCTION(apache_request_headers) /* {{{ */

0 commit comments

Comments
 (0)