Plugin Directory


Ignore:
Timestamp:
10/14/2026 08:02:34 PM (7 days ago)
Author:
hivepress
Message:

Release 1.8.0

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hivepress/trunk/includes/controllers/class-attachment.php

    r3655262 r3747070  
    173173
    174174                // Check file.
    175                 if ( ! isset( $_FILES['file'] ) ) {
     175                if ( ! isset( $_FILES['file'] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing -- REST API request; WordPress requires a valid REST nonce for cookie authentication, otherwise the user is not logged in.
    176176                        return hp\rest_error( 400 );
    177177                }
    178178
    179179                // Check file format.
    180                 if ( $parent_field->get_formats() && ! hivepress()->attachment->is_valid_file( $_FILES['file']['tmp_name'], $_FILES['file']['name'], $parent_field->get_formats() ) ) {
     180                if ( $parent_field->get_formats() && ! hivepress()->attachment->is_valid_file( $_FILES['file']['tmp_name'], $_FILES['file']['name'], $parent_field->get_formats() ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput.InputNotValidated, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized -- REST API request with WordPress REST nonce check; the file type is validated by wp_check_filetype_and_ext() in is_valid_file() and by media_handle_upload().
    181181
    182182                        /* translators: %s: file extensions. */
Note: See TracChangeset for help on using the changeset viewer.