1
0
mirror of https://github.com/php/php-src.git synced 2026-03-26 17:22:15 +01:00

Fix #8486 (name= without quotes in MIME Content-Disposition header)

Ported fix by kk/sas from PHP 3
This commit is contained in:
Stanislav Malyshev
2001-01-03 10:52:26 +00:00
parent 6b23ef6cef
commit ea46f79a97

View File

@@ -167,11 +167,20 @@ static void php_mime_split(char *buf, int cnt, char *boundary, zval *array_ptr S
SAFE_RETURN;
}
loc = memchr(ptr, '\n', rem);
name = strstr(ptr, " name=\"");
name = strstr(ptr, " name=");
if (name && name < loc) {
name += 7;
name += 6;
s = memchr(name, '\"', loc - name);
if (!s) {
if ( name == s ) {
name++;
s = memchr(name, '\"', loc - name);
if(!s) {
php_error(E_WARNING, "File Upload Mime headers garbled name: [%c%c%c%c%c]", *name, *(name + 1), *(name + 2), *(name + 3), *(name + 4));
SAFE_RETURN;
}
} else if(!s) {
s = loc;
} else {
php_error(E_WARNING, "File Upload Mime headers garbled name: [%c%c%c%c%c]", *name, *(name + 1), *(name + 2), *(name + 3), *(name + 4));
SAFE_RETURN;
}