[wp-trac] [WordPress Trac] #57386: Add filter to WP_Upgrader::install_package for copy_dir()

WordPress Trac noreply at wordpress.org
Sat Jan 7 02:17:16 UTC 2023


#57386: Add filter to WP_Upgrader::install_package for copy_dir()
-----------------------------+--------------------------
 Reporter:  afragen          |       Owner:  (none)
     Type:  feature request  |      Status:  reopened
 Priority:  normal           |   Milestone:  6.2
Component:  Upgrade/Install  |     Version:  trunk
 Severity:  normal           |  Resolution:
 Keywords:  has-patch        |     Focuses:  performance
-----------------------------+--------------------------

Comment (by azaozz):

 Thanks, I think I understand the problem here better now.

 > VirtualBox users should not have to make any changes to work around
 core.

 I agree. It is unfortunate that this bug hasn't been fixed in VB. If I
 understand how this works (looking at
 https://www.virtualbox.org/ticket/8761#comment:24) seems it would be very
 hard to trigger the bug. For this two directories with identical names
 will have to be moved, and the first has to be moved to the exact spot
 where the second was. Then if a file that exists in both directories is
 deleted in the first directory (that now occupies the spot where the
 second directory was), it gets deleted in the second directory.

 Wondering if VirtualBox can be detected from PHP running in the guest OS?
 Tried searching the web but no clear answer. Seems it may be possible, for
 example looking at the video card (or other hardware) manufacturer string.
 If yes, I wouldn't be opposed to having a separate function to detect it.

 Then it will be possible to use the new `move_dir()` by default, and this
 filter won't probably be needed.

 Another, "last resort" solution may be to "hide" the new `move_dir()`
 functionality inside one of the rollback functions and use it only for
 rollbacks. Not ideal but will avoid triggering the VB bug. The advantage
 is that it will work for "everybody" out of the box.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/57386#comment:21>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list