PluginProbe
Media Cloud Sync / 1.4.1
Media Cloud Sync v1.4.1
1.4.1 1.4.0 1.3.12 1.3.11 1.3.10 trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.2.0 1.2.10 1.2.11 1.2.12 1.2.13 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 All 35 releases
← All changes | includes/base/services/cloudflare-r2.php +9 -2 1.4.01.4.1 View file →
@@ -608,9 +608,9 @@
608 608 /**
609 609 * Upload Single
610 610 * @since 1.0.0
611 611 */
612 - public function uploadSingle($absolute_source_path, $relative_source_path, $prefix='') {
612 + public function uploadSingle($absolute_source_path, $relative_source_path, $prefix='', $is_private = false) {
613 613 if (
614 614 isset($absolute_source_path) && !empty($absolute_source_path) &&
615 615 isset($relative_source_path) && !empty($relative_source_path)
616 616 ) {
@@ -615,9 +615,16 @@
615 615 isset($relative_source_path) && !empty($relative_source_path)
616 616 ) {
617 617 $file_name = wp_basename( $relative_source_path );
618 618 if ($file_name) {
619 - $upload_path = Utils::generate_object_key($relative_source_path, $prefix);
619 + $upload_path = Utils::generate_object_key($relative_source_path, $prefix, $is_private);
620 + if ($upload_path === false) {
621 + return [
622 + 'success' => false,
623 + 'code' => 200,
624 + 'message' => esc_html__('This file is marked private, but the private-media add-on is not currently active — reupload skipped to avoid exposing it.', 'media-cloud-sync')
625 + ];
626 + }
620 627 return $this->execute_upload($absolute_source_path, $upload_path);
621 628 }
622 629 }
623 630