Browse Source

Minor tweak to the file upload hooks. The MULTIPART_EVENT_FORMDATA event

was only triggering when an input filter was applied.  This simple change
makes the event also trigger when no filter is applied.  The newlength
pointer is set to NULL to let a downstream module differentiate between
the two cases.
PECL_OPENSSL
Rasmus Lerdorf 20 years ago
parent
commit
935b0c88e9
  1. 10
      main/rfc1867.c

10
main/rfc1867.c

@ -952,7 +952,17 @@ SAPI_API SAPI_POST_HANDLER_FUNC(rfc1867_post_handler)
#else
safe_php_register_variable(param, value, new_val_len, array_ptr, 0 TSRMLS_CC);
#endif
} else if (php_rfc1867_callback != NULL) {
multipart_event_formdata event_formdata;
event_formdata.post_bytes_processed = SG(read_post_bytes);
event_formdata.name = param;
event_formdata.value = &value;
event_formdata.length = value_len;
event_formdata.newlength = NULL;
php_rfc1867_callback(MULTIPART_EVENT_FORMDATA, &event_formdata, &event_extra_data TSRMLS_CC);
}
if (!strcasecmp(param, "MAX_FILE_SIZE")) {
max_file_size = atol(value);
}

Loading…
Cancel
Save