Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#52210 new defect (bug)

File URL gets saved even when upload fails

Reported by: kkroeger93's profile kkroeger93 Owned by:
Milestone: Awaiting Review Priority: normal
Severity: major Version: 5.6
Component: Database Keywords:
Focuses: Cc:


A File URL reference gets saved into the wp_posts table even when upload fails.

I recognized the issue when I uploaded a attachment into my WordPress Site.

Steps I performed:

1. Uploaded a file that was not allowed (e.g a file with .svg ext)
The upload failed because I didn't had the ALLOW_UNFILTERED_UPLOADS Constant set to true.

2. Changed the ALLOW_UNFILTERED_UPLOADS constant to true and re-uplaoded the file.
The file upload worked this time.

3. Tried to open the attachment
I realized that the URL was altert by a filename-1.ext.

Things I checked:

I checked the Changesets and found this Change Log:

I assume there is a Bug which saves the upload attempt into regardless if its completed successfully or not.

Change History (1)

#1 @9primus
3 years ago

Hello kkroeger93 ! I can not performed this bug , when I have only 'ALLOW_UNFILTERED_UPLOADS' in wp-config.php , frontend js code stops me to download SVG image , but when I have 'ALLOW_UNFILTERED_UPLOADS' in wp-config and

add_filter('plupload_default_settings', function ($settings) {

in my functions.php file its work fine

Note: See TracTickets for help on using tickets.