Skip to content

Commit ca6b5b0

Browse files
author
Björn Tantau
committed
Remove is_anonymous checks, like in 61ba79d.
1 parent 21e4ea4 commit ca6b5b0

File tree

1 file changed

+1
-45
lines changed

1 file changed

+1
-45
lines changed

main/rfc1867.c

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -678,7 +678,7 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
678678
int boundary_len = 0, cancel_upload = 0, is_arr_upload = 0;
679679
size_t array_len = 0;
680680
int64_t total_bytes = 0, max_file_size = 0;
681-
int skip_upload = 0, anonymous_index = 0, is_anonymous;
681+
int skip_upload = 0, anonymous_index = 0;
682682
HashTable *uploaded_files = NULL;
683683
multipart_buffer *mbuff;
684684
zval *array_ptr = (zval *) arg;
@@ -921,11 +921,8 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
921921
}
922922

923923
if (!param) {
924-
is_anonymous = 1;
925924
param = emalloc(MAX_SIZE_ANONNAME);
926925
snprintf(param, MAX_SIZE_ANONNAME, "%u", anonymous_index++);
927-
} else {
928-
is_anonymous = 0;
929926
}
930927

931928
/* New Rule: never repair potential malicious user input */
@@ -1138,10 +1135,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11381135
s = filename;
11391136
}
11401137

1141-
if (!is_anonymous) {
1142-
safe_php_register_variable(lbuf, s, strlen(s), NULL, 0);
1143-
}
1144-
11451138
/* Add $foo[name] */
11461139
if (is_arr_upload) {
11471140
snprintf(lbuf, llen, "%s[name][%s]", abuf, array_index);
@@ -1169,10 +1162,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11691162
/* Add full path of supplied file for folder uploads via
11701163
* <input type="file" name="files" multiple webkitdirectory>
11711164
*/
1172-
if (!is_anonymous) {
1173-
safe_php_register_variable(lbuf, filename, strlen(filename), NULL, 0);
1174-
}
1175-
11761165
/* Add $foo[fullname] */
11771166
if (is_arr_upload) {
11781167
snprintf(lbuf, llen, "%s[fullpath][%s]", abuf, array_index);
@@ -1193,16 +1182,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
11931182
}
11941183
}
11951184

1196-
/* Add $foo_type */
1197-
if (is_arr_upload) {
1198-
snprintf(lbuf, llen, "%s_type[%s]", abuf, array_index);
1199-
} else {
1200-
snprintf(lbuf, llen, "%s_type", param);
1201-
}
1202-
if (!is_anonymous) {
1203-
safe_php_register_variable(lbuf, cd, strlen(cd), NULL, 0);
1204-
}
1205-
12061185
/* Add $foo[type] */
12071186
if (is_arr_upload) {
12081187
snprintf(lbuf, llen, "%s[type][%s]", abuf, array_index);
@@ -1225,16 +1204,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
12251204
/* Initialize variables */
12261205
add_protected_variable(param);
12271206

1228-
/* if param is of form xxx[.*] this will cut it to xxx */
1229-
if (!is_anonymous) {
1230-
if (temp_filename) {
1231-
ZVAL_STR_COPY(&zfilename, temp_filename);
1232-
} else {
1233-
ZVAL_EMPTY_STRING(&zfilename);
1234-
}
1235-
safe_php_register_variable_ex(param, &zfilename, NULL, 1);
1236-
}
1237-
12381207
/* Add $foo[tmp_name] */
12391208
if (is_arr_upload) {
12401209
snprintf(lbuf, llen, "%s[tmp_name][%s]", abuf, array_index);
@@ -1287,19 +1256,6 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler) /* {{{ */
12871256
}
12881257
register_http_post_files_variable_ex(lbuf, &error_type, &PG(http_globals)[TRACK_VARS_FILES], 0);
12891258

1290-
/* Add $foo_size */
1291-
if (is_arr_upload) {
1292-
snprintf(lbuf, llen, "%s_size[%s]", abuf, array_index);
1293-
} else {
1294-
snprintf(lbuf, llen, "%s_size", param);
1295-
}
1296-
if (!is_anonymous) {
1297-
if (size_overflow) {
1298-
ZVAL_STRING(&file_size, file_size_buf);
1299-
}
1300-
safe_php_register_variable_ex(lbuf, &file_size, NULL, size_overflow);
1301-
}
1302-
13031259
/* Add $foo[size] */
13041260
if (is_arr_upload) {
13051261
snprintf(lbuf, llen, "%s[size][%s]", abuf, array_index);

0 commit comments

Comments
 (0)