[Webkit-unassigned] [Bug 225299] Constructing a FormData from a form can lead to entries with lone surrogates

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


https://bugs.webkit.org/show_bug.cgi?id=225299

Chris Dumez <cdumez at apple.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
 Attachment #445352|review?, commit-queue?      |review+, commit-queue-
              Flags|                            |

--- 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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20211130/55aa8dc9/attachment-0001.htm>


More information about the webkit-unassigned mailing list