mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Automatically add favicon host to CSP if present
This commit is contained in:
parent
8bf4727555
commit
5bba3dac82
1 changed files with 6 additions and 0 deletions
|
|
@ -42,6 +42,12 @@ abstract class Api
|
||||||
$CSP->report = $oConfig->Get('security', 'csp_report', false);
|
$CSP->report = $oConfig->Get('security', 'csp_report', false);
|
||||||
$CSP->report_only = $oConfig->Get('debug', 'enable', false); // || SNAPPYMAIL_DEV
|
$CSP->report_only = $oConfig->Get('debug', 'enable', false); // || SNAPPYMAIL_DEV
|
||||||
|
|
||||||
|
// Allow favicon host, if present
|
||||||
|
$parsedFaviconUrl = parse_url($oConfig->Get('webmail', 'favicon_url', ''));
|
||||||
|
if (is_array($parsedFaviconUrl) && array_key_exists('host', $parsedFaviconUrl)) {
|
||||||
|
$CSP->add('img-src', $parsedFaviconUrl['host']);
|
||||||
|
}
|
||||||
|
|
||||||
// Allow https: due to remote images in e-mails or use proxy
|
// Allow https: due to remote images in e-mails or use proxy
|
||||||
if (!$oConfig->Get('labs', 'use_local_proxy_for_external_images', '')) {
|
if (!$oConfig->Get('labs', 'use_local_proxy_for_external_images', '')) {
|
||||||
$CSP->add('img-src', 'https:');
|
$CSP->add('img-src', 'https:');
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue