From 507b23f49afcea544eb5bb15c074239b4035de6b Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Fri, 23 Dec 2016 11:38:42 +0100 Subject: [PATCH] Fixed embedded media w/o thumbnail --- .../files/js/3rdParty/redactor2/plugins/WoltLabMedia.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMedia.js b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMedia.js index 21646f031e..7c3bb1acfa 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMedia.js +++ b/wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMedia.js @@ -25,7 +25,13 @@ $.Redactor.prototype.WoltLabMedia = function() { var image = elCreate('img'); image.className = 'woltlabSuiteMedia' + float; //noinspection JSUnresolvedVariable - image.src = this.opts.woltlab.mediaUrl.replace(/&/, '&').replace('-123456789', data.attributes[0]).replace('thumbnail=void', 'thumbnail=' + data.attributes[1]); + image.src = this.opts.woltlab.mediaUrl.replace(/&/, '&').replace('-123456789', data.attributes[0]).replace('thumbnail=void', function () { + if (data.attributes[1]) { + return 'thumbnail=' + data.attributes[1]; + } + + return ''; + }); elData(image, 'media-id', data.attributes[0]); elData(image, 'media-size', data.attributes[1]); -- 2.20.1