From f60381deca7c012ec6fcffe530dfd28245232026 Mon Sep 17 00:00:00 2001 From: "Ian M. Jones" Date: Thu, 2 Aug 2018 10:50:22 +0100 Subject: [PATCH] Deploying version 1.4.3 --- README.md | 5 ++++- .../streams/aws-s3-stream-wrapper.php | 20 ++++++++++++++++++- languages/amazon-s3-and-cloudfront-en.pot | 2 +- readme.txt | 5 ++++- wordpress-s3.php | 4 ++-- 5 files changed, 30 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index da96f649..daee0aa0 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ **Requires at least:** 4.6 **Tested up to:** 4.9 **Requires PHP:** 5.5 -**Stable tag:** 1.4.2 +**Stable tag:** 1.4.3 **License:** GPLv3 Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery. @@ -71,6 +71,9 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin ## Changelog ## +### WP Offload S3 Lite 1.4.3 - 2018-08-02 ### +* Bug fix: Images remotely edited via stream wrapper sometimes set as private on S3 + ### WP Offload S3 Lite 1.4.2 - 2018-07-03 ### * Bug fix: Error getting bucket region * Bug fix: Child themes with missing or broken style.css break diagnostic info diff --git a/classes/providers/streams/aws-s3-stream-wrapper.php b/classes/providers/streams/aws-s3-stream-wrapper.php index bf4c0c6b..ce793e7e 100644 --- a/classes/providers/streams/aws-s3-stream-wrapper.php +++ b/classes/providers/streams/aws-s3-stream-wrapper.php @@ -2,11 +2,29 @@ namespace DeliciousBrains\WP_Offload_S3\Providers\Streams; +use DeliciousBrains\WP_Offload_S3\Aws3\Aws\CacheInterface; +use DeliciousBrains\WP_Offload_S3\Aws3\Aws\S3\S3ClientInterface; use DeliciousBrains\WP_Offload_S3\Aws3\Aws\S3\StreamWrapper; use DeliciousBrains\WP_Offload_S3\Providers\AWS_Provider; class AWS_S3_Stream_Wrapper extends StreamWrapper { + public static $wrapper; + + /** + * Register the 's3://' stream wrapper + * + * @param S3ClientInterface $client Client to use with the stream wrapper + * @param string $protocol Protocol to register as. + * @param CacheInterface $cache Default cache for the protocol. + */ + public static function register( S3ClientInterface $client, $protocol = 's3', CacheInterface $cache = null ) { + // Keep a shadow copy of the protocol for use with context options. + static::$wrapper = $protocol; + + parent::register( $client, $protocol, $cache ); + } + /** * Overrides so we don't check for stat on directories * @@ -67,7 +85,7 @@ public function stream_flush() { $options = stream_context_get_options( $context ); // Set the ACL as public by default - $options['ACL'] = AWS_Provider::DEFAULT_ACL; + $options[ static::$wrapper ]['ACL'] = AWS_Provider::DEFAULT_ACL; $options = apply_filters( 'wpos3_stream_flush_params', $options ); diff --git a/languages/amazon-s3-and-cloudfront-en.pot b/languages/amazon-s3-and-cloudfront-en.pot index a155f55b..790c2505 100644 --- a/languages/amazon-s3-and-cloudfront-en.pot +++ b/languages/amazon-s3-and-cloudfront-en.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: amazon-s3-and-cloudfront\n" "Report-Msgid-Bugs-To: nom@deliciousbrains.com\n" -"POT-Creation-Date: 2018-07-03 16:30+0100\n" +"POT-Creation-Date: 2018-08-02 10:25+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" diff --git a/readme.txt b/readme.txt index 3e8b765f..d539efdc 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: uploads, amazon, s3, amazon s3, mirror, admin, media, cdn, cloudfront Requires at least: 4.6 Tested up to: 4.9 Requires PHP: 5.5 -Stable tag: 1.4.2 +Stable tag: 1.4.3 License: GPLv3 Copies files to Amazon S3 as they are uploaded to the Media Library. Optionally configure Amazon CloudFront for faster delivery. @@ -67,6 +67,9 @@ This version requires PHP 5.3.3+ and the Amazon Web Services plugin == Changelog == += WP Offload S3 Lite 1.4.3 - 2018-08-02 = +* Bug fix: Images remotely edited via stream wrapper sometimes set as private on S3 + = WP Offload S3 Lite 1.4.2 - 2018-07-03 = * Bug fix: Error getting bucket region * Bug fix: Child themes with missing or broken style.css break diagnostic info diff --git a/wordpress-s3.php b/wordpress-s3.php index 1e801bf0..31cabfa7 100644 --- a/wordpress-s3.php +++ b/wordpress-s3.php @@ -4,7 +4,7 @@ Plugin URI: http://wordpress.org/extend/plugins/amazon-s3-and-cloudfront/ Description: Automatically copies media uploads to Amazon S3 for storage and delivery. Optionally configure Amazon CloudFront for even faster delivery. Author: Delicious Brains -Version: 1.4.2 +Version: 1.4.3 Author URI: https://deliciousbrains.com/ Network: True Text Domain: amazon-s3-and-cloudfront @@ -26,7 +26,7 @@ // Then completely rewritten. */ -$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '1.4.2'; +$GLOBALS['aws_meta']['amazon-s3-and-cloudfront']['version'] = '1.4.3'; require_once dirname( __FILE__ ) . '/classes/as3cf-compatibility-check.php';