Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ $tests = [
"text/html; ;; ; ;; Charset=\"ISO-8859-1\"",
"text/html;Charset=\"ISO-8859-1",
"tex.t/h#\$%!&'*%2B-.^_`|~tml;Charset=\"ISO-8859-1\"", // Note: have to encode + as 2B because of implementation details of http_server()
"text/html; abcd=ef;charset=ISO-8859-1",
],
"Valid input, but invalid encoding name" => [
"text/html;Charset=\"ISO-8859-1\\",
Expand Down Expand Up @@ -100,6 +101,7 @@ foreach ($tests as $name => $headers) {
äöü
äöü
äöü
äöü
--- Valid input, but invalid encoding name ---
���
���
Expand Down
2 changes: 1 addition & 1 deletion ext/libxml/mime_sniff.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ PHP_LIBXML_API zend_string *php_libxml_sniff_charset_from_string(const char *sta
/* 11.9.1. Set parameterValue to the result of collecting a sequence of code points that are not ';' */
size_t parameter_value_length = collect_a_sequence_of_code_points(start, end, is_not_semicolon);
parameter_value = zend_string_init(start, parameter_value_length, false);
start += parameter_name_length;
start += parameter_value_length;

/* 11.9.2. Remove trailing HTTP whitespace from parameterValue */
while (ZSTR_LEN(parameter_value) > 0 && is_http_whitespace(ZSTR_VAL(parameter_value)[ZSTR_LEN(parameter_value) - 1])) {
Expand Down
Loading