mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
Userland: Allow unquoted 'filename' values in 'pro'
This commit is contained in:
parent
441807f96d
commit
7e72285049
Notes:
sideshowbarker
2024-07-19 02:57:23 +09:00
Author: https://github.com/alimpfard Commit: https://github.com/SerenityOS/serenity/commit/7e72285049e Pull-request: https://github.com/SerenityOS/serenity/pull/3368
1 changed files with 14 additions and 2 deletions
|
@ -57,7 +57,16 @@ public:
|
|||
if (lexer.consume_specific(";")) {
|
||||
lexer.ignore_while(is_whitespace);
|
||||
if (lexer.consume_specific("filename=")) {
|
||||
m_filename = lexer.consume_quoted_string();
|
||||
// RFC 2183: "A short (length <= 78 characters)
|
||||
// parameter value containing only non-`tspecials' characters SHOULD be
|
||||
// represented as a single `token'."
|
||||
// Some people seem to take this as generic advice of "if it doesn't have special characters,
|
||||
// it's safe to specify as a single token"
|
||||
// So let's just be as lenient as possible.
|
||||
if (lexer.next_is('"'))
|
||||
m_filename = lexer.consume_quoted_string();
|
||||
else
|
||||
m_filename = lexer.consume_until(is_any_of("()<>@,;:\\\"/[]?= "));
|
||||
} else {
|
||||
m_might_be_wrong = true;
|
||||
}
|
||||
|
@ -72,7 +81,10 @@ public:
|
|||
if (lexer.consume_specific("name=")) {
|
||||
m_name = lexer.consume_quoted_string();
|
||||
} else if (lexer.consume_specific("filename=")) {
|
||||
m_filename = lexer.consume_quoted_string();
|
||||
if (lexer.next_is('"'))
|
||||
m_filename = lexer.consume_quoted_string();
|
||||
else
|
||||
m_filename = lexer.consume_until(is_any_of("()<>@,;:\\\"/[]?= "));
|
||||
} else {
|
||||
m_might_be_wrong = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue