File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
cloudinary-image-management-and-manipulation-in-the-cloud-cdn/php Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -1257,6 +1257,10 @@ public function get_asset_payload() {
12571257 $ asset ['sync_key ' ] = $ asset ['public_id ' ];
12581258 if ( ! empty ( $ data ['asset ' ]['derived ' ] ) ) {
12591259 $ asset ['url ' ] = filter_var ( $ data ['asset ' ]['derived ' ][0 ]['secure_url ' ], FILTER_SANITIZE_URL );
1260+ $ format = pathinfo ( $ asset ['url ' ], PATHINFO_EXTENSION );
1261+ if ( $ format !== $ data ['asset ' ]['format ' ] ) {
1262+ $ asset ['sync_key ' ] .= '. ' . $ format ;
1263+ }
12601264 }
12611265
12621266 //convert_media_extension
@@ -1274,7 +1278,7 @@ public function get_asset_payload() {
12741278 // Check for transformations.
12751279 $ transformations = $ this ->get_transformations_from_string ( $ asset ['url ' ] );
12761280 if ( ! empty ( $ transformations ) ) {
1277- $ asset ['sync_key ' ] .= wp_json_encode ( $ transformations );
1281+ $ asset ['sync_key ' ] .= wp_json_encode ( $ transformations );
12781282 $ asset ['transformations ' ] = $ transformations ;
12791283 }
12801284 // Attempt to find attachment ID.
You can’t perform that action at this time.
0 commit comments