Make WordPress Core

Opened 5 years ago

Last modified 3 years ago

#37719 new feature request

Pre/Post Unzip Hooks

Reported by: dfavor Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Filesystem API Keywords: needs-patch 2nd-opinion
Focuses: Cc:


Add Pre/Post hooks to unzip logic, providing groundwork for advanced Malware scanning + advanced role management by interacting with OS using chattr facility to enforce super admin capabilities, requiring OS level authentication prior to taking action on any zipfile contents.


1) Refactor _unzip_file_pclzip() + _unzip_file_ziparchive() merge into single function + merge common code.

2) Hooks...

required_disk_space - notify how much additional disk space required
required_directories - notify list of missing directories, which will be created

pre_unzip - return zipfile path + archive component name if applicable
post_unzip - return zipfile path + unzip directory + archive component name if applicable

3) Additionally, zipfile source propagation could be highly useful.

Either local filesystem reference or download URL.

Change History (2)

#1 @swissspidy
5 years ago

  • Version 4.7 deleted

#2 @desrosj
3 years ago

  • Keywords needs-patch 2nd-opinion added
Note: See TracTickets for help on using tickets.