mirror of
https://github.com/WordPress/WordPress.git
synced 2024-10-03 01:58:13 +02:00
Upgrade/Install: Send language pack updates to copy_dir()
.
If the `clear_working` flag in `WP_Upgrader::install_package()` is false, the source should not be removed, so `copy_dir()` should be used instead. Partial updates, like language packs, may want to retain the destination. If the destination exists or has contents, this may be a partial update, and the destination should not be removed, so `copy_dir()` should be used instead. Follow-up to [55204], [55219], [55220], [55223], [55226]. Props afragen, costdev, swissspidy. See #57557. Built from https://develop.svn.wordpress.org/trunk@55229 git-svn-id: http://core.svn.wordpress.org/trunk@54762 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
5c1f181c0a
commit
ba4ed5f86c
@ -588,15 +588,19 @@ class WP_Upgrader {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Partial updates may want to retain the destination.
|
* If 'clear_working' is false, the source should not be removed, so use copy_dir() instead.
|
||||||
* move_dir() returns a WP_Error when the destination exists,
|
|
||||||
* so copy_dir() should be used.
|
|
||||||
*
|
*
|
||||||
* If 'clear_working' is false, the source shouldn't be removed.
|
* Partial updates, like language packs, may want to retain the destination.
|
||||||
* After move_dir() runs, the source will no longer exist.
|
* If the destination exists or has contents, this may be a partial update,
|
||||||
* Therefore, copy_dir() should be used.
|
* and the destination should not be removed, so use copy_dir() instead.
|
||||||
*/
|
*/
|
||||||
if ( $clear_destination && $args['clear_working'] ) {
|
if ( $args['clear_working']
|
||||||
|
&& (
|
||||||
|
// Destination does not exist or has no contents.
|
||||||
|
! $wp_filesystem->exists( $remote_destination )
|
||||||
|
|| empty( $wp_filesystem->dirlist( $remote_destination ) )
|
||||||
|
)
|
||||||
|
) {
|
||||||
$result = move_dir( $source, $remote_destination, true );
|
$result = move_dir( $source, $remote_destination, true );
|
||||||
} else {
|
} else {
|
||||||
// Create destination if needed.
|
// Create destination if needed.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '6.2-alpha-55228';
|
$wp_version = '6.2-alpha-55229';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user