<!-- /message.general.share -->
<!-- message.general.image -->
+ <option name="message_force_secure_images">
+ <categoryname>message.general.image</categoryname>
+ <optiontype>boolean</optiontype>
+ <defaultvalue>0</defaultvalue>
+ </option>
<option name="module_image_proxy">
<categoryname>message.general.image</categoryname>
<optiontype>boolean</optiontype>
'wcf.editor.image.float.left': '{lang}wcf.editor.image.float.left{/lang}',
'wcf.editor.image.float.right': '{lang}wcf.editor.image.float.right{/lang}',
'wcf.editor.image.source': '{lang}wcf.editor.image.source{/lang}',
+ 'wcf.editor.image.source.error.insecure': '{lang}wcf.editor.image.source.error.insecure{/lang}',
'wcf.editor.image.source.error.invalid': '{lang}wcf.editor.image.source.error.invalid{/lang}',
'wcf.editor.link.add': '{lang}wcf.editor.link.add{/lang}',
buttons: buttonOptions,
buttonMobile: buttonMobile,
customButtons: customButtons,
+ forceSecureImages: {if MESSAGE_FORCE_SECURE_IMAGES}true{else}false{/if},
highlighters: highlighters,
media: {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}true{else}false{/if},
mediaUrl: '{link controller='Media' id=-123456789 thumbnail='void' forceFrontend=true}{/link}'
define('EDIT_HISTORY_EXPIRATION', 90);
define('ENABLE_SHARE_BUTTONS', 1);
define('SHARE_BUTTONS_PROVIDERS', '');
+define('MESSAGE_FORCE_SECURE_IMAGES', 0);
define('MODULE_IMAGE_PROXY', 0);
define('IMAGE_PROXY_INSECURE_ONLY', 0);
define('IMAGE_PROXY_EXPIRATION', 14);
'wcf.editor.image.float.left': '{lang}wcf.editor.image.float.left{/lang}',
'wcf.editor.image.float.right': '{lang}wcf.editor.image.float.right{/lang}',
'wcf.editor.image.source': '{lang}wcf.editor.image.source{/lang}',
+ 'wcf.editor.image.source.error.insecure': '{lang}wcf.editor.image.source.error.insecure{/lang}',
'wcf.editor.image.source.error.invalid': '{lang}wcf.editor.image.source.error.invalid{/lang}',
'wcf.editor.link.add': '{lang}wcf.editor.link.add{/lang}',
buttons: buttonOptions,
buttonMobile: buttonMobile,
customButtons: customButtons,
+ forceSecureImages: {if MESSAGE_FORCE_SECURE_IMAGES}true{else}false{/if},
highlighters: highlighters,
media: {if $__wcf->session->getPermission('admin.content.cms.canUseMedia')}true{else}false{/if},
mediaUrl: '{link controller='Media' id=-123456789 thumbnail='void' forceFrontend=true}{/link}'
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'));
+ }
// update image source
image.src = source;
if ($this->bypassProxy($urlComponents['host'])) {
// check if page was requested over a secure connection
// but the link is insecure
- if (RouteHandler::secureConnection() && $urlComponents['scheme'] === 'http') {
+ if ((MESSAGE_FORCE_SECURE_IMAGES || RouteHandler::secureConnection()) && $urlComponents['scheme'] === 'http') {
// rewrite protocol to `https`
$element->setAttribute('src', preg_replace('~^http~', 'https', $src));
}
$element->setAttribute('srcset', $srcset);
}
}
+ else if (MESSAGE_FORCE_SECURE_IMAGES && Url::parse($src)['scheme'] === 'http') {
+ // rewrite protocol to `https`
+ $element->setAttribute('src', preg_replace('~^http~', 'https', $src));
+ }
}
}
}
<item name="wcf.acp.option.article_show_about_author"><![CDATA[„Über den Autor“ anzeigen]]></item>
<item name="wcf.acp.option.category.message.general.image"><![CDATA[Bilder]]></item>
<item name="wcf.acp.option.module_article"><![CDATA[Artikel]]></item>
+ <item name="wcf.acp.option.message_force_secure_images"><![CDATA[Nur sichere Bilder in Nachrichten erlauben]]></item>
+ <item name="wcf.acp.option.message_force_secure_images.description"><![CDATA[Bilder dürfen nur über das verschlüsselte „https“-Protokoll eingebunden werden. Bereits in bestehenden Nachrichten hinterlegte Bilder werden zwangsweise auf dieses Protokoll umgeschrieben.]]></item>
<item name="wcf.acp.option.module_image_proxy"><![CDATA[Zwischenspeicherung von externen Bilder aktivieren]]></item>
<item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Speicherzeit]]></item>
<item name="wcf.acp.option.image_proxy_insecure_only"><![CDATA[Nur Bilder aus unverschlüsselten Quellen zwischenspeichern]]></item>
<item name="wcf.editor.image.float.left"><![CDATA[Links]]></item>
<item name="wcf.editor.image.float.right"><![CDATA[Rechts]]></item>
<item name="wcf.editor.image.source"><![CDATA[Quelle]]></item>
+ <item name="wcf.editor.image.source.error.insecure"><![CDATA[Unsichere Adressen („http://“) wurden für Bilder deaktiviert, bitte verwenden Sie nur sichere Adressen („https://“).]]></item>
<item name="wcf.editor.image.source.error.invalid"><![CDATA[Der eingegebene Link ist ungültig.]]></item>
<item name="wcf.editor.link.add"><![CDATA[Link einfügen]]></item>
<item name="wcf.acp.option.article_show_about_author"><![CDATA[Display “about the author” box]]></item>
<item name="wcf.acp.option.category.message.general.image"><![CDATA[Images]]></item>
<item name="wcf.acp.option.module_article"><![CDATA[Articles]]></item>
+ <item name="wcf.acp.option.message_force_secure_images"><![CDATA[Allow secure images only]]></item>
+ <item name="wcf.acp.option.message_force_secure_images.description"><![CDATA[Images may only be embedded using the encrypted “https”-protocol. Images in already existing messages will be force-rewritten to use the secure protocol.]]></item>
<item name="wcf.acp.option.module_image_proxy"><![CDATA[Enable image proxy]]></item>
<item name="wcf.acp.option.image_proxy_expiration"><![CDATA[Storage Time Period]]></item>
<item name="wcf.acp.option.image_proxy_insecure_only"><![CDATA[Store images from insecure sources only]]></item>
<item name="wcf.editor.image.float.left"><![CDATA[Left]]></item>
<item name="wcf.editor.image.float.right"><![CDATA[Right]]></item>
<item name="wcf.editor.image.source"><![CDATA[Source]]></item>
+ <item name="wcf.editor.image.source.error.insecure"><![CDATA[Insecure sources (“http://”) for images have been disabled, please use secure sources only (“https://”).]]></item>
<item name="wcf.editor.image.source.error.invalid"><![CDATA[You have entered an invalid link.]]></item>
<item name="wcf.editor.link.add"><![CDATA[Insert Link]]></item>