Skip to content

Commit

Permalink
* Fix for StorageImageEditor class that should improve compatibility …
Browse files Browse the repository at this point in the history
…with other plugins using the image editor but

  storing the results in non-standard places.  Should fix problems with a variety of form and social plugins (Gravity,
  Peepso, others).
  • Loading branch information
jawngee committed Nov 11, 2022
1 parent f453057 commit e327d5c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
6 changes: 5 additions & 1 deletion classes/Tools/Storage/StorageImageEditor.php
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ public function save( $destfilename = null, $mime_type = null ) {

} else {
$dir = wp_get_upload_dir();
if (strpos($destfilename, $dir['basedir']) !== 0) {
if (strpos($destfilename, ABSPATH) !== 0) {
$destfilename = trailingslashit($dir['basedir']).$destfilename;
$destPath = pathinfo($destfilename, PATHINFO_DIRNAME);
if (!file_exists($destPath)) {
@mkdir($destPath, 0777, true);
}
}

$result = $this->imageEditor->save($destfilename, $mime_type);
Expand Down
4 changes: 2 additions & 2 deletions ilab-media-tools.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
Plugin URI: https://github.com/interfacelab/ilab-media-tools
Description: Automatically upload media to Amazon S3 and integrate with Imgix, a real-time image processing CDN. Boosts site performance and simplifies workflows.
Author: interfacelab
Version: 4.5.10
Version: 4.5.11
Requires PHP: 7.4
Author URI: http://interfacelab.io
*/
Expand Down Expand Up @@ -95,7 +95,7 @@
}

// Version Defines
define( 'MEDIA_CLOUD_VERSION', '4.5.10' );
define( 'MEDIA_CLOUD_VERSION', '4.5.11' );
define( 'MEDIA_CLOUD_INFO_VERSION', '4.0.2' );
define( 'MCLOUD_IS_BETA', false );
// Debugging
Expand Down
8 changes: 7 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Requires at least: 4.9
Tested up to: 6.1
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Stable tag: 4.5.10
Stable tag: 4.5.11
Requires PHP: 7.4

Automatically store media on Amazon S3, Cloudflare R2, Google Cloud Storage, DigitalOcean Spaces + others. Serve CSS/JS assets through CDNs. Integrate with Imgix.
Expand Down Expand Up @@ -105,6 +105,12 @@ Imgix is a content delivery network with a twist. In addition to distributing y

== Changelog ==

= 4.5.11 - 11/09/2022 =

* Fix for StorageImageEditor class that should improve compatibility with other plugins using the image editor but
storing the results in non-standard places. Should fix problems with a variety of form and social plugins (Gravity,
Peepso, others).

= 4.5.10 - 11/09/2022 =

* Fix for broken Crop, Edit Image and Replace Image buttons in the media library.
Expand Down

0 comments on commit e327d5c

Please sign in to comment.