Skip to content

Commit c1a39c9

Browse files
authored
Release version 4.1.5 (#100)
Merge pull request #100 from short-pixel-optimizer/hotfix-4.1.5
2 parents 3cde582 + 22b198d commit c1a39c9

File tree

6 files changed

+21
-12
lines changed

6 files changed

+21
-12
lines changed

build/shortpixel/log/src/ShortPixelLogger.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ public function __construct()
8282
{
8383
if (defined('SHORTPIXEL_LOG_OVERWRITE')) // if overwrite, do this on init once.
8484
file_put_contents($this->logPath,'-- Log Reset -- ' .PHP_EOL);
85-
8685
}
8786

8887
if ($this->is_active)

classes/emr-plugin.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ public function adminInit()
5656
{
5757
$this->features['replace'] = true; // does nothing just for completeness
5858
$this->features['background'] = apply_filters('emr/feature/background', true);
59+
$this->features['remote_notice'] = apply_filters('emr/feature/remote_notice', true);
5960

6061
load_plugin_textdomain('enable-media-replace', false, basename(dirname(EMR_ROOT_FILE)) . '/languages');
6162

@@ -86,6 +87,9 @@ public function useFeature($name)
8687
case 'background':
8788
$bool = $this->features['background'];
8889
break;
90+
case 'remote_notice':
91+
$bool = $this->features['remote_notice'];
92+
break;
8993
default:
9094
$bool = false;
9195
break;
@@ -190,9 +194,8 @@ public function setScreen()
190194
$screen = get_current_screen();
191195

192196
$notice_pages = array('attachment', 'media_page_enable-media-replace/enable-media-replace', 'upload' );
193-
if ( in_array($screen->id, $notice_pages) && true === emr()->useFeature('background'))
197+
if ( in_array($screen->id, $notice_pages) && true === emr()->useFeature('remote_notice'))
194198
{
195-
196199
RemoteNoticeController::getInstance(); // check for remote stuff
197200
$notices = Notices::getInstance();
198201
$notices->loadIcons(array(

classes/uihelper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,8 @@ public function getFormUrl($attach_id, $action = null)
5454
if (is_numeric($spdebug))
5555
$spdebug = intval($spdebug);
5656
else {
57-
$spdebug = sanitize_text_field($spdebug);
57+
$spdebug = 3;
5858
}
59-
6059
$url = add_query_arg('SHORTPIXEL_DEBUG', $spdebug, $url);
6160
}
6261

@@ -75,9 +74,8 @@ public function getSuccesRedirect($attach_id)
7574
if (is_numeric($spdebug))
7675
$spdebug = intval($spdebug);
7776
else {
78-
$spdebug = sanitize_text_field($spdebug);
77+
$spdebug = 3;
7978
}
80-
8179
$url = add_query_arg('SHORTPIXEL_DEBUG', $spdebug, $url);
8280
}
8381

enable-media-replace.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: Enable Media Replace
44
* Plugin URI: https://wordpress.org/plugins/enable-media-replace/
55
* Description: Enable replacing media files by uploading a new file in the "Edit Media" section of the WordPress Media Library.
6-
* Version: 4.1.4
6+
* Version: 4.1.5
77
* Author: ShortPixel
88
* Author URI: https://shortpixel.com
99
* GitHub Plugin URI: https://github.com/short-pixel-optimizer/enable-media-replace
@@ -25,7 +25,7 @@
2525
*
2626
*/
2727

28-
define( 'EMR_VERSION', '4.1.4' );
28+
define( 'EMR_VERSION', '4.1.5' );
2929

3030
if ( ! defined( 'ABSPATH' ) ) {
3131
exit; // Exit if accessed directly.

readme.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: replace, attachment, media, files, replace image, remove background, repla
55
Requires at least: 4.9.7
66
Tested up to: 6.3
77
Requires PHP: 5.6
8-
Stable tag: 4.1.4
8+
Stable tag: 4.1.5
99

1010
Easily replace any attached image/file by simply uploading a new file in the Media Library edit view - a real time saver!
1111

@@ -38,6 +38,10 @@ If you don't want to use the background removal feature, add this line to your t
3838

3939
```add_filter( 'emr/feature/background', '__return_false' );```
4040

41+
A similar filter, for the remote notification system is:
42+
43+
```add_filter( 'emr/feature/remote_notice', '__return_false' );```
44+
4145
To shorten the wait time before redirecting to the media editing screen, use the following filter and specify the wait time in seconds (0 means that redirection is immediate, but may cause problems in certain configurations):
4246

4347
```add_filter('emr/success/timeout', function () { return 3; });```
@@ -69,6 +73,12 @@ If you want more control over the format in which the time is shown, you can use
6973

7074
== Changelog ==
7175

76+
= 4.1.5 =
77+
78+
Release date: December 14, 2023
79+
* Tweak: Added a filter to disable the remote notification system added in version 4.1.0;
80+
* Fix: A potential "Reflected Cross-Site Scripting" vulnerability has been patched, responsibly disclosed by the Wordfence team.
81+
7282
= 4.1.4 =
7383

7484
Release date: September 22, 2023

views/screen.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,13 @@
4545
<?php
4646

4747
$formurl = $uiHelper->getFormUrl($attachment_id);
48-
//$formurl = wp_nonce_url( $url, "media_replace_upload" );
4948

5049
if (FORCE_SSL_ADMIN) {
5150
$formurl = str_replace("http:", "https:", $formurl);
5251
}
5352
?>
5453

55-
<form enctype="multipart/form-data" method="POST" action="<?php echo $formurl; ?>">
54+
<form enctype="multipart/form-data" method="POST" action="<?php echo esc_url($formurl); ?>">
5655
<?php wp_nonce_field('media_replace_upload', 'emr_nonce'); ?>
5756

5857
<div class='editor-wrapper'>

0 commit comments

Comments
 (0)