You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
filenames in multipart/form-data are not percent decoded #8206
RFC 7578#2 specifies percent-encoding for use in HTTP
So nowadays special characters, specifically the double quote (") are percent-encoded instead of backslash-encoded and PHP should properly decode those, like it already does for backslash encoding.
Windows user here, so I can't send files with names containing double-quotes, so just to clarify: do UAs send "foo.txt as %22foo.txt? Apparently, %22foo.txt is sent as %22foo.txt, so these file names couldn't be distinguished.
Side note: we probably need to make CURLOPT_MIME_OPTIONS and CURLMIMEOPT_FORMESCAPE available as soon as possible (and possibly default to CURLMIMEOPT_FORMESCAPE for BC reasons).
For field names and filenames for file fields, the result of the encoding in the previous bullet point must be escaped by replacing any 0x0A (LF) bytes with the byte sequence %0A, 0x0D (CR) with %0D and 0x22 (") with %22. The user agent must not perform any other escapes.
So these browsers appear to behave according to that standard (although that standardized behavior makes no sense).
Activity
cmb69 commentedon Mar 17, 2022
Windows user here, so I can't send files with names containing double-quotes, so just to clarify: do UAs send
"foo.txtas%22foo.txt? Apparently,%22foo.txtis sent as%22foo.txt, so these file names couldn't be distinguished.Side note: we probably need to make
CURLOPT_MIME_OPTIONSandCURLMIMEOPT_FORMESCAPEavailable as soon as possible (and possibly default toCURLMIMEOPT_FORMESCAPEfor BC reasons).TimWolla commentedon Mar 17, 2022
Chrome:
".txt:%22.txt:For Firefox the behavior is identical.
curl 7.68.0:
curl 7.82.0:
TimWolla commentedon Mar 17, 2022
@cmb69 It appears you are correct here. I'll check with the #curl IRC once more.
TimWolla commentedon Mar 17, 2022
I've filed a Chrome bug for this: https://bugs.chromium.org/p/chromium/issues/detail?id=1307324
cmb69 commentedon Mar 17, 2022
Well, the WHATWG living "standard" currently claims:
So these browsers appear to behave according to that standard (although that standardized behavior makes no sense).
TimWolla commentedon Mar 21, 2022
Yeah, the browsers are probably in the best position to push for an updated standard, though.