WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 8 months 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:
PR Number:

Description

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.

Logic...

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
3 years ago

  • Version 4.7 deleted

#2 @desrosj
8 months ago

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