Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Core_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ public function download( $args, $assoc_args ) {
}

if ( ! $cache_file || $bad_cache ) {
$temp = Utils\get_temp_dir() . uniqid( 'wp_' ) . '.tmp';
$temp = Utils\make_temp_file( 'wp_', '.tmp' );
register_shutdown_function(
function () use ( &$temp ) {
if ( file_exists( $temp ) ) {
Expand Down Expand Up @@ -2242,7 +2242,7 @@ private function remove_directory( $dir, $abspath_realpath_trailing ) {
}

private static function strip_content_dir( $zip_file ) {
$new_zip_file = Utils\get_temp_dir() . uniqid( 'wp_' ) . '.zip';
$new_zip_file = Utils\make_temp_file( 'wp_', '.zip' );
register_shutdown_function(
function () use ( $new_zip_file ) {
if ( file_exists( $new_zip_file ) ) {
Expand Down
2 changes: 1 addition & 1 deletion src/WP_CLI/Core/CoreUpgrader.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public function download_package( $package, $check_signatures = false, $hook_ext
$filename = pathinfo( $package, PATHINFO_FILENAME );
$extension = pathinfo( $package, PATHINFO_EXTENSION );

$temp = Utils\get_temp_dir() . uniqid( 'wp_' ) . ".{$extension}";
$temp = Utils\make_temp_file( 'wp_', ".{$extension}" );
register_shutdown_function(
function () use ( $temp ) {
if ( file_exists( $temp ) ) {
Expand Down