[wp-trac] [WordPress Trac] #48710: Media uploader does not restrict file upload `accepts` parameters based on current context

WordPress Trac noreply at wordpress.org
Mon Nov 18 10:14:20 UTC 2024


#48710: Media uploader does not restrict file upload `accepts` parameters based on
current context
------------------------------------------+----------------------------
 Reporter:  worddean                      |       Owner:  joedolson
     Type:  defect (bug)                  |      Status:  accepted
 Priority:  normal                        |   Milestone:  6.8
Component:  Media                         |     Version:
 Severity:  normal                        |  Resolution:
 Keywords:  needs-patch has-testing-info  |     Focuses:  accessibility
------------------------------------------+----------------------------
Changes (by sukhendu2002):

 * keywords:  needs-patch => needs-patch has-testing-info


Comment:

 == Reproduction Report
 === Description

 This report validates whether the issue regarding uploading a PDF in the
 Image block and subsequent errors when deleting the file from the Media
 Library can be reproduced.

 === Environment

 - WordPress: 6.7
 - PHP: 8.2.25
 - Server: nginx/1.27.2
 - Database: mysqli (Server: 8.0.40 )
 - Browser: Chrome 131.0.6778.69
 - OS: macOS
 - Theme: Twenty Twenty-Five 1.0
 - MU Plugins: None activated
 - Plugins: None activated

 === Steps to Reproduce

 1. Navigate to a post in the Block Editor.
 2. Add an Image block to the post.
 3. Use the "Upload" option in the Image block to upload a PDF file.
 4. Observe that the PDF thumbnail is displayed with errors.
 5. Delete the uploaded PDF file from the Media Library.
 6. Return to the post or refresh the editor.

 === Actual Results

 - After uploading the PDF thumbnail is displayed with errors.
     - **`Warning**: Undefined array key "file" in **/var/www/src/wp-
 includes/media.php** on line **1759**`
     - **`Deprecated**: preg_match(): Passing null to parameter #2
 ($subject) of type string is deprecated in **/var/www/src/wp-
 includes/media.php** on line **1759**`
 - After deleting the PDF from the Media Library, the block in the editor
 displays the error message:`"This image has an empty alt attribute: its
 file name is... .pdf"`.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/48710#comment:58>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list