summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Lerdorf <rasmus@php.net>2006-09-09 22:06:27 +0000
committerRasmus Lerdorf <rasmus@php.net>2006-09-09 22:06:27 +0000
commit935b0c88e9772f165db25cb04b7497645b66c414 (patch)
tree79b94cb25b737738489cf6f511fc9b0b39b7a1c3
parent0222d506c277299f59edaec5dfb0593803fd8551 (diff)
downloadphp-git-935b0c88e9772f165db25cb04b7497645b66c414.tar.gz
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.
-rw-r--r--main/rfc1867.c10
1 files changed, 10 insertions, 0 deletions
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);
}