From 935b0c88e9772f165db25cb04b7497645b66c414 Mon Sep 17 00:00:00 2001 From: Rasmus Lerdorf Date: Sat, 9 Sep 2006 22:06:27 +0000 Subject: [PATCH] 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. --- main/rfc1867.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/main/rfc1867.c b/main/rfc1867.c index 5961853f89..699b0cfda0 100644 --- a/main/rfc1867.c +++ b/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); } -- 2.50.1