- Timestamp:
- 10/14/2026 08:02:34 PM (7 days ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
hivepress/trunk/includes/controllers/class-attachment.php
r3655262 r3747070 173 173 174 174 // 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. 176 176 return hp\rest_error( 400 ); 177 177 } 178 178 179 179 // 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(). 181 181 182 182 /* translators: %s: file extensions. */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)