Skip to content

Commit 67535a7

Browse files
authored
Release version 4.1.7 (#104)
Merge pull request #104 from short-pixel-optimizer/hotfix-4.1.7
2 parents 534aa12 + b15fb11 commit 67535a7

File tree

4 files changed

+24
-16
lines changed

4 files changed

+24
-16
lines changed

classes/ViewController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ protected function viewError($errorCode, $errorData = array())
114114
$message = __('Error updating WordPress post in the database', 'enable-media-replace');
115115
break;
116116
case self::ERROR_DIRECTORY_SECURITY:
117-
$message = __('Specificed directory is outside the upload directory. This is not allowed for security reasons', 'enable-media-replace');
117+
$message = __('Specified directory is outside the upload directory. This is not allowed for security reasons', 'enable-media-replace');
118118
$path = isset($errorData['path']) ? $errorData['path'] : false;
119119
$basedir = isset($errorData['basedir']) ? $errorData['basedir'] : false;
120120

@@ -124,7 +124,7 @@ protected function viewError($errorCode, $errorData = array())
124124
}
125125
break;
126126
case self::ERROR_DIRECTORY_NOTEXIST:
127-
$message = __('Specificed new directory does not exist. Path must be a relative path from the upload directory and exist', 'enable-media-replace');
127+
$message = __('Specified new directory does not exist. Path must be a relative path from the upload directory and exist', 'enable-media-replace');
128128
break;
129129

130130
case self::ERROR_NONCE:

classes/emr-plugin.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -642,20 +642,17 @@ public function attempt_uncache_image($image, $attachment_id, $size, $icon)
642642
* @return string content / replacement shorttag
643643
* @todo Note this returns the wrong date, ie. server date not corrected for timezone. Function could be removed altogether, not sure about purpose.
644644
*/
645-
public function get_modified_date($atts)
645+
public function get_modified_date($args)
646646
{
647-
$id=0;
648-
$format= '';
649647

650-
extract(shortcode_atts(array(
651-
'id' => '',
652-
'format' => get_option('date_format') . " " . get_option('time_format'),
653-
), $atts));
648+
$id = isset($args['id']) ? intval($args['id']) : false;
649+
$format = isset($args['format']) ? sanitize_text_field($args['format']) : false;
654650

655-
if ($id == '') {
656-
return false;
651+
if (false === $id)
652+
{
653+
return false;
657654
}
658-
655+
659656
// Get path to file
660657
$current_file = get_attached_file($id);
661658

@@ -666,9 +663,14 @@ public function get_modified_date($atts)
666663
// Get file modification time
667664
$filetime = filemtime($current_file);
668665

666+
if (false === $format)
667+
{
668+
$format = get_option( 'date_format' ) . ' ' . get_option( 'time_format' );
669+
}
670+
669671
if (false !== $filetime) {
670672
// do date conversion
671-
return date($format, $filetime);
673+
return wp_date($format, $filetime);
672674
}
673675

674676
return false;

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.6
6+
* Version: 4.1.7
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.6' );
28+
define( 'EMR_VERSION', '4.1.7' );
2929

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

readme.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: replace, replace image, remove background, replace jpg, change media
55
Requires at least: 4.9.7
66
Tested up to: 6.8
77
Requires PHP: 5.6
8-
Stable tag: 4.1.6
8+
Stable tag: 4.1.7
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -80,6 +80,12 @@ Please report security bugs found in the source code of the Enable Media Replace
8080

8181
== Changelog ==
8282

83+
= 4.1.7 =
84+
85+
Release date: October 2, 2025
86+
* Fix: A potential "Cross-Site Scripting" vulnerability has been patched, responsibly disclosed by the WordFence team;
87+
* Fix: Corrected a few text typos.
88+
8389
= 4.1.6 =
8490

8591
Release date: March 25, 2025

0 commit comments

Comments
 (0)