Skip to content

Commit

Permalink
Deploying version 2.5.5
Browse files Browse the repository at this point in the history
  • Loading branch information
ianmjones committed Jul 19, 2021
1 parent cd9fd21 commit 87b569a
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 85 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
**Contributors:** bradt, deliciousbrains, ianmjones
**Tags:** uploads, amazon, s3, amazon s3, digitalocean, digitalocean spaces, google cloud storage, gcs, mirror, admin, media, cdn, cloudfront
**Requires at least:** 4.9
**Tested up to:** 5.7
**Tested up to:** 5.8
**Requires PHP:** 5.5
**Stable tag:** 2.5.3
**Stable tag:** 2.5.5
**License:** GPLv3

Copies files to Amazon S3, DigitalOcean Spaces or Google Cloud Storage as they are uploaded to the Media Library. Optionally configure Amazon CloudFront or another CDN for faster delivery.
Expand Down Expand Up @@ -89,6 +89,11 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin

## Changelog ##

### WP Offload Media Lite 2.5.5 - 2021-07-19 ###
* Bug fix: Signed GCS URLs broken when updating a post
* Bug fix: Incorrect mime type set on scaled image's bucket object when thumbnail format differs from original file's format
* Tested: WordPress 5.8

### WP Offload Media Lite 2.5.3 - 2021-03-03 ###
* New: Added DigitalOcean region San Francisco 3
* Bug fix: Domain mapping not handled correctly when the local URL includes a port number
Expand Down
5 changes: 3 additions & 2 deletions classes/amazon-s3-and-cloudfront.php
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,8 @@ public function upload_attachment( $post_id, $data = null, $file_path = null, $f
$type = get_post_mime_type( $post_id );
$allowed_types = $this->get_allowed_mime_types();

// check mime type of file is in allowed provider mime types
// Check mime type of file is in allowed provider mime types.
// Note: This check is based on the item's original upload format.
if ( ! in_array( $type, $allowed_types ) ) {
$error_msg = sprintf( __( 'Mime type %s is not allowed', 'amazon-s3-and-cloudfront' ), $type );

Expand Down Expand Up @@ -1577,7 +1578,7 @@ public function upload_attachment( $post_id, $data = null, $file_path = null, $f
'Bucket' => $bucket,
'Key' => $prefix . $file_name,
'SourceFile' => $file_path,
'ContentType' => $type,
'ContentType' => $this->get_mime_type( $file_path ),
'CacheControl' => 'max-age=31536000',
'Expires' => date( 'D, d M Y H:i:s O', time() + 31536000 ),
);
Expand Down
2 changes: 1 addition & 1 deletion classes/as3cf-filter.php
Original file line number Diff line number Diff line change
Expand Up @@ -849,7 +849,7 @@ protected function should_filter_content() {
* @return string
*/
public static function remove_aws_query_strings( $content, $base_url = '' ) {
$pattern = '\?[^\s"<\?]*(?:X-Amz-Algorithm|AWSAccessKeyId|Key-Pair-Id)=[^\s"<\?]+';
$pattern = '\?[^\s"<\?]*(?:X-Amz-Algorithm|AWSAccessKeyId|Key-Pair-Id|GoogleAccessId)=[^\s"<\?]+';
$group = 0;

if ( ! is_string( $content ) ) {
Expand Down
Loading

0 comments on commit 87b569a

Please sign in to comment.