PluginProbe
Media Cloud Sync / 1.4.2
Media Cloud Sync v1.4.2
1.4.2 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 All 36 releases
← All changes | includes/compatbility/compatibility.php +22 -0 1.4.1 → 1.4.2 View file →
@@ -50,8 +50,9 @@
50 50 add_filter( 'wpmcs_get_attached_file_noop', array( $this, 'image_editor_download_file' ), 10, 4 );
51 51 add_filter( 'wpmcs_get_attached_file', array( $this, 'image_editor_download_file' ), 10, 4 );
52 52 add_filter( 'wpmcs_get_attached_file', array( $this, 'customizer_crop_download_file' ), 10, 4 );
53 53 add_filter( 'wpmcs_pre_update_item_additional_files_to_remove_from_server', [ $this, 'customizer_crop_remove_restored_files' ], 10, 5 );
54 + add_filter( 'wpmcs_do_reupload_media', [ $this, 'force_reupload_on_image_editor_save' ], 10, 3 );
54 55
55 56 /*
56 57 * WP_Customize_Control
57 58 * /wp-includes/class-wp-customize_control.php
@@ -200,8 +201,29 @@
200 201 }
201 202
202 203 return $url;
203 204 }
205 +
206 + /**
207 + * A flip or 180° rotation changes pixel content without changing any
208 + * declared width/height, which shouldForceReupload() can't detect —
209 + * force it explicitly for any image-editor commit (save or restore).
210 + * @since 1.4.3
211 + */
212 + public function force_reupload_on_image_editor_save($do_reupload, $attachment_id, $source_type) {
213 + if ($do_reupload) {
214 + return $do_reupload;
215 + }
216 +
217 + $action = Utils::filter_input('action', INPUT_GET) ?: Utils::filter_input('action', INPUT_POST);
218 + $do = Utils::filter_input('do', INPUT_POST);
219 +
220 + if (in_array($do, ['save', 'restore'], true) && in_array($action, ['image-editor', 'imgedit-preview'], true)) {
221 + return true;
222 + }
223 +
224 + return $do_reupload;
225 + }
204 226
205 227
206 228
207 229