WordPress.org

Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#38083 closed defect (bug) (wontfix)

Regression: Change in File_Upload_Upgrader::__construct() in WP 4.6.1 (not in 4.6) broke working plugin

Reported by: DavidAnderson Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.6.1
Component: Upgrade/Install Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

This change - [38525] in WP 4.6.1 broke my plugin - https://plugins.svn.wordpress.org/upload-larger-plugins/tags/1.4/ .

I was using the upgrader_pre_download filter to over-ride the package (i.e. zip) that gets installed. However, the added check now makes that method impossible, because it applies a new consistency check. And specifically, realpath() returns false if the file in the parameter does not exist, causing the check to fail, and wp_die() to be called. If the two paths are compared without realpath() being called, the check would pass (i.e. the second string is indeed a substring of the first)... but because realpath() is introducing an implicit "file must exist" condition, it now fails.

This renders the upgrader_pre_download filter useless for what I was doing, and I've had to go back to a much less elegant method used in the plugin before WP 3.7 to achieve the over-ride. https://plugins.svn.wordpress.org/upload-larger-plugins/tags/1.4.1/

I don't know if this will have broken any other plugins.

Change History (2)

#1 @SergeyBiryukov
5 years ago

  • Component changed from General to Upgrade/Install
  • Description modified (diff)
  • Milestone changed from Awaiting Review to 4.6.2

#2 @dd32
5 years ago

  • Milestone 4.6.2 deleted
  • Resolution set to wontfix
  • Status changed from new to closed

Without further reports, I'm marking this as wontfix due to the nature of the change and File_Upload_Upgrader not really being designed for this use-case.

The alteration was in the WordPress 3.3 back-compat branch, and IMHO would be better achieved by duplicating the few lines of File_Upload_Upgrader which are needed.

Note: See TracTickets for help on using tickets.