Core Update: Fix a issue which caused automatic upgrades from 2.7 to 3.5+ to fail. Pre-2.7 WP_Filesystem::wp_content_dir() returned unslashed paths. Introduced in [22227]. See #23177
git-svn-id: http://core.svn.wordpress.org/trunk@23297 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e841b1f3cf
commit
33d913220b
|
@ -644,7 +644,8 @@ function update_core($from, $to) {
|
|||
}
|
||||
|
||||
// Import $wp_version, $required_php_version, and $required_mysql_version from the new version
|
||||
$versions_file = $wp_filesystem->wp_content_dir() . 'upgrade/version-current.php';
|
||||
// $wp_filesystem->wp_content_dir() returned unslashed pre-2.8
|
||||
$versions_file = trailingslashit( $wp_filesystem->wp_content_dir() ) . 'upgrade/version-current.php';
|
||||
if ( ! $wp_filesystem->copy( $from . $distro . 'wp-includes/version.php', $versions_file ) ) {
|
||||
$wp_filesystem->delete( $from, true );
|
||||
return new WP_Error( 'copy_failed', __('Could not copy file.') );
|
||||
|
|
Loading…
Reference in New Issue