Skip to content

Commit fb57ae9

Browse files
committed
Improve comment on RFC 1867 filename handling
It was pointed out on the internals ML[1] that the basename comment around RFC 1867 file handling was confusing. The comment seemed to say that the basename handling was only necessary because of some esoteric bug in Windows IE. In fact that comment applied to earlier versions of the code and was, therefore, misleading. The comment needs to clear that basename is required per RFC 7578[2]. [1]:https://externals.io/message/108624 [2]:https://tools.ietf.org/html/rfc7578
1 parent 4f89211 commit fb57ae9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

main/rfc1867.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,11 +1136,11 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11361136
snprintf(lbuf, llen, "%s_name", param);
11371137
}
11381138

1139-
/* The \ check should technically be needed for win32 systems only where
1140-
* it is a valid path separator. However, IE in all it's wisdom always sends
1141-
* the full path of the file on the user's filesystem, which means that unless
1142-
* the user does basename() they get a bogus file name. Until IE's user base drops
1143-
* to nill or problem is fixed this code must remain enabled for all systems. */
1139+
/* Pursuant to RFC 7578, strip any path components in the
1140+
* user-supplied file name:
1141+
* > If a "filename" parameter is supplied ... do not use
1142+
* > directory path information that may be present."
1143+
*/
11441144
s = _basename(internal_encoding, filename);
11451145
if (!s) {
11461146
s = filename;

0 commit comments

Comments
 (0)