This commit is contained in:
Javier Casares 2026-07-18 13:29:38 +00:00
commit 916d7845be

View file

@ -29,7 +29,7 @@ class Media_Uploader {
/**
* Attachment IDs currently being uploaded, to prevent re-entrant calls.
*
* wp_update_post() (used to update the attachment GUID) fires edit_attachment,
* Calling wp_update_post() to update the attachment GUID fires edit_attachment,
* which would re-trigger upload_attachment_to_idrivee2() causing infinite recursion.
*
* @var array<int, bool>
@ -145,7 +145,7 @@ class Media_Uploader {
$base_path = path_join( $basedir, $meta_file );
$meta_sizes = isset( $meta['sizes'] ) && is_array( $meta['sizes'] ) ? $meta['sizes'] : array();
/** @var array<string, string> $files */
/* @var array<string, string> $files */
$files = array( 'original' => $base_path );
foreach ( $meta_sizes as $size ) {
if ( is_array( $size ) && isset( $size['file'] ) && is_string( $size['file'] ) ) {
@ -157,8 +157,8 @@ class Media_Uploader {
$client = $this->client_factory->create();
$bucket = $this->config->get_bucket();
$commands = array();
$key_map = array(); // int index -> file metadata
$handles = array(); // int index -> resource
$key_map = array(); // int index -> file metadata.
$handles = array(); // int index -> resource.
$real_basedir = realpath( $basedir );
$idx = 0;