fix: imageSize option was broken

This commit is contained in:
wolfgang101 2024-11-22 11:43:33 +01:00
parent a445431819
commit dee77bb7c2
2 changed files with 8 additions and 5 deletions

View File

@ -3,7 +3,7 @@
Plugin Name: Include Mastodon Feed
Plugin URI: https://wolfgang.lol/code/include-mastodon-feed-wordpress-plugin
Description: Plugin providing [include-mastodon-feed] shortcode
Version: 1.9.6
Version: 1.9.7
Author: wolfgang.lol
Author URI: https://wolfgang.lol
*/
@ -370,10 +370,10 @@ function init_scripts() {
if('image' == media.type) {
let mediaElemImgLink = mastodonFeedCreateElement('a');
let imageUrl = media.url;
if('full' === options.images.size && null !== media.remote_url) {
if(null !== media.remote_url) {
imageUrl = media.remote_url;
}
else if(null !== media.preview_url) {
else if('full' !== options.images.size && null !== media.preview_url) {
imageUrl = media.preview_url;
}
mediaElemImgLink.href = status.url;

View File

@ -5,7 +5,7 @@ Tags: mastodon, status, feed
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.9.6
Stable tag: 1.9.7
License: Expat License
License URI: https://directory.fsf.org/wiki/License:Expat
@ -154,11 +154,14 @@ Use the following URL to get your ID:
== Changelog ==
= 1.9.7 =
* fix option to either display smaller image media attachment previews (default) or large image versions (thank you @beach@illo.social)
= 1.9.6 =
* fixed XSS vulnerability where authenticated attackers with contributor permissions could insert malicious JavaScript
= 1.9.5 =
* added option to either display smaller image media attachment previews (default) or large image versions
* added option to either display smaller image media attachment previews (default) or large image versions (thank you @beach@illo.social)
* added option to point image media attachment links to either status (default) or image
= 1.9.4 =