Fixed embedded media w/o thumbnail
authorAlexander Ebert <ebert@woltlab.com>
Fri, 23 Dec 2016 10:38:42 +0000 (11:38 +0100)
committerAlexander Ebert <ebert@woltlab.com>
Fri, 23 Dec 2016 10:38:42 +0000 (11:38 +0100)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabMedia.js

index 21646f031e7c18bf8e5c1345583c468a681ae939..7c3bb1acfa916bed528669cebcde2531febed022 100644 (file)
@@ -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(/&amp;/, '&').replace('-123456789', data.attributes[0]).replace('thumbnail=void', 'thumbnail=' + data.attributes[1]);
+                               image.src = this.opts.woltlab.mediaUrl.replace(/&amp;/, '&').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]);