]> granicus.if.org Git - php/commitdiff
Minor tweak to the file upload hooks. The MULTIPART_EVENT_FORMDATA event
authorRasmus Lerdorf <rasmus@php.net>
Sat, 9 Sep 2006 22:06:27 +0000 (22:06 +0000)
committerRasmus Lerdorf <rasmus@php.net>
Sat, 9 Sep 2006 22:06:27 +0000 (22:06 +0000)
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

index 5961853f89786cc00ab1c19e5d470af74383c2d1..699b0cfda0edf99a1b3500152cb11e4b38826ce8 100644 (file)
@@ -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);
                                }