Files
ladybird/Libraries/LibWeb/HTML/HTMLInputElement.cpp
Praise-Garfield 36d8191a3d LibWeb: Chain all accept attribute checks in parse_accept_attribute()
The wildcard checks for audio/* and video/* are standalone if
statements, while the MIME-type and extension branches are
else-if chained only to the image/* check. When a token like
"audio/*" arrives, it matches the first if (adding
FileType::Audio) and then falls through to the MIME-type
else-if. MimeType::parse() accepts the wildcard because * is a
valid HTTP token code point, so a second MimeType{"audio/*"}
entry is added. FileFilter::add_filter() deduplicates within
variant types but cannot catch this cross-type duplication.

This chains all five conditions into a single if/else-if,
matching the spec's mutually exclusive "one of the following"
wording.
2026-02-13 15:32:36 -05:00

176 KiB