Issue with wp_handle_upload_prefilter and REST API Uploads
-
In the
limit_uploadfunction, which is registered with thewp_handle_upload_prefilterfilter, the following code is present:add_filter( 'wp_handle_upload_prefilter', array( $this, 'limit_upload' ), 10, 1 );
......
if ( ! is_admin() ) {
if ( ! empty( $post) && 'ticket' !== $post->post_type && $submission !== $post->ID ) {
return $file;
}
}The current logic only checks for
is_admin(). Consequently, for file uploads made via the REST API, the function doesn’t check if the request is a ticket submission. As a result, only file types specified by Awesome Support are allowed, and all other uploads fail.Please ensure that future versions also check whether the request is from the REST API.
Thanks in advance.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Issue with wp_handle_upload_prefilter and REST API Uploads’ is closed to new replies.