Skip to content

Commit fc6539b

Browse files
Merge pull request #1152 from Codeinwp/fix/fallback_image_block
refactor: apply forced HTTPS only to feed img
2 parents b325e3d + 18da478 commit fc6539b

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

js/FeedzyBlock/Editor.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -312,16 +312,20 @@ class Editor extends Component {
312312

313313
getImageURL(item, background) {
314314
let url;
315-
if (item.thumbnail && this.props.attributes.thumb === 'auto') {
316-
url = item.thumbnail;
315+
if (
316+
item.thumbnail &&
317+
this.props.attributes.thumb === 'auto' &&
318+
item.thumbnail !== item.default_img
319+
) {
320+
url = item.thumbnail.replace(/http:/g, 'https:');
317321
} else if (this.props.attributes.default) {
318322
url = this.props.attributes.default.url;
323+
} else if (item.default_img) {
324+
url = item.default_img;
319325
} else {
320326
url = window.feedzyjs.imagepath + 'feedzy.svg';
321327
}
322328

323-
url = url.replace(/http:/g, 'https:');
324-
325329
if (background) {
326330
url = 'url("' + url + '")';
327331
}

0 commit comments

Comments
 (0)