[webkit-reviews] review granted: [Bug 225299] Constructing a FormData from a form can lead to entries with lone surrogates : [Attachment 445352] Patch

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Nov 30 08:14:41 PST 2021


Chris Dumez <cdumez at apple.com> has granted Andreu Botella
<andreu at andreubotella.com>'s request for review:
Bug 225299: Constructing a FormData from a form can lead to entries with lone
surrogates
https://bugs.webkit.org/show_bug.cgi?id=225299

Attachment 445352: Patch

https://bugs.webkit.org/attachment.cgi?id=445352&action=review




--- Comment #5 from Chris Dumez <cdumez at apple.com> ---
Comment on attachment 445352
  --> https://bugs.webkit.org/attachment.cgi?id=445352
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=445352&action=review

r=me with comments.

> Source/WebCore/html/DOMFormData.cpp:81
> +    return { usvName, usvValue };

We could write this in a more concise way:

return {
    replaceUnpairedSurrogatesWithReplacementCharacter(String { usvName }),
    replaceUnpairedSurrogatesWithReplacementCharacter(String { usvValue })
};

> Source/WebCore/html/DOMFormData.cpp:88
> +    usvName =
replaceUnpairedSurrogatesWithReplacementCharacter(WTFMove(usvName));

I think this would look a bit nicer:
auto usvName = replaceUnpairedSurrogatesWithReplacementCharacter(String {
usvName });

> Source/WebCore/html/DOMFormData.h:83
> +    Item createStringEntry(const String& name, const String& value);

It seems this can be static. Also, since it is private, no need to declare it
in the header.


More information about the webkit-reviews mailing list