Enforce SSL/TLS policy for inserted images
authorAlexander Ebert <ebert@woltlab.com>
Sat, 30 Jun 2018 10:26:37 +0000 (12:26 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Sat, 30 Jun 2018 10:26:37 +0000 (12:26 +0200)
wcfsetup/install/files/js/3rdParty/redactor2/plugins/WoltLabImage.js

index 2e3ea8f78eb9779a5788d9e6727cacaf64342f8b..4e5029d502766374077111e0eaa695d59838e1c1 100644 (file)
@@ -142,6 +142,9 @@ $.Redactor.prototype.WoltLabImage = function() {
                        else if (!source.match(this.opts.regexps.url)) {
                                return showError(sourceInput, WCF.Language.get('wcf.editor.image.source.error.invalid'));
                        }
+                       else if (this.opts.woltlab.forceSecureImages && source.indexOf('http://') === 0) {
+                               return showError(sourceInput, WCF.Language.get('wcf.editor.image.source.error.insecure'));
+                       }
                        
                        // check if link is valid
                        var linkInput = elById('redactor-image-link');