Opened 8 years ago
Last modified 2 weeks ago
#44710 new defect (bug)
Upload plugin and theme functionalities are not removing uploaded files after failure conditions.
| Reported by: | rawrly | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Awaiting Review |
| Component: | Administration | Version: | 4.9.7 |
| Severity: | normal | Keywords: | has-patch has-unit-tests |
| Cc: | Focuses: |
Description
Within wp-admin, an administrator user may upload files by using the Upload Plugin functionality (Plugins -> Add New -> Upload plugin) and the Upload Theme functionality (Appearance -> Themes -> Add New -> Upload Theme)
These processes uploads the user submitted file to /wp-content/uploads/{month} first, then attempts to extract it to the plugins or theme directory (The form expects a .zip file, yet allows any mime-type or extension for uploaded files, such as images, or .php files). If the process fails for any reason the uploaded file remains in /wp-content/uploads/ and/or /wp-content/upgrade/
It would be best if the plugin and theme upload functionalities properly clean up the uploaded files if a plugin or theme fail to properly get extracted and/or installed.
Note: On successful installations of a plugin or theme, the uploaded file is being properly removed from /wp-content/uploads/ and/or /wp-content/upgrade/
Attachments (1)
Change History (6)
#3
@
7 years ago
Hi All,
I've tried to fix this and added code for that in wp-admin/includes/class-wp-upgrader.php file.
#4
@
6 years ago
Hi, I've tried the patch on WordPress 5.6, but the zip file after failed installation doesn't delete in /wp-content/upgrade/. Does this will be patch in later version WordPress?
This ticket was mentioned in PR #12676 on WordPress/wordpress-develop by @arkaprabhachowdhury.
2 weeks ago
#5
- Keywords has-patch has-unit-tests added; needs-patch removed
Ensures extracted upgrade working directories are removed when package installation fails and clear_working is enabled. Adds focused regression coverage for the failure path.
Tests: phpunit tests/phpunit/tests/admin/wpUpgrader.php (108 tests, 347 assertions).
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
I have tested this issue and I have the same thing. I'm working on the patch for it and will supply it soon.