mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-28 19:49:20 +03:00
Bugfix: forgot debug js/css setting change in Nextcloud
This commit is contained in:
parent
5cadccb985
commit
a88c2e94f9
2 changed files with 7 additions and 22 deletions
|
|
@ -16,10 +16,7 @@ class ContentSecurityPolicy extends \OCP\AppFramework\Http\ContentSecurityPolicy
|
|||
function __construct() {
|
||||
$CSP = \RainLoop\Api::getCSP();
|
||||
|
||||
$this->allowedScriptDomains = \array_unique(\array_merge(
|
||||
$this->allowedScriptDomains,
|
||||
$CSP->script
|
||||
));
|
||||
$this->allowedScriptDomains = \array_unique(\array_merge($this->allowedScriptDomains, $CSP->script));
|
||||
$this->allowedScriptDomains = \array_diff($this->allowedScriptDomains, ["'unsafe-inline'", "'unsafe-eval'"]);
|
||||
|
||||
// Nextcloud only sets 'strict-dynamic' when browserSupportsCspV3() ?
|
||||
|
|
@ -27,26 +24,14 @@ class ContentSecurityPolicy extends \OCP\AppFramework\Http\ContentSecurityPolicy
|
|||
? $this->useStrictDynamic(true) // NC24+
|
||||
: $this->addAllowedScriptDomain("'strict-dynamic'");
|
||||
|
||||
$this->allowedImageDomains = \array_unique(\array_merge(
|
||||
$this->allowedImageDomains,
|
||||
$CSP->img
|
||||
));
|
||||
$this->allowedImageDomains = \array_unique(\array_merge($this->allowedImageDomains, $CSP->img));
|
||||
|
||||
$this->allowedStyleDomains = \array_unique(\array_merge(
|
||||
$this->allowedStyleDomains,
|
||||
$CSP->style
|
||||
));
|
||||
$this->allowedStyleDomains = \array_unique(\array_merge($this->allowedStyleDomains, $CSP->style));
|
||||
$this->allowedStyleDomains = \array_diff($this->allowedStyleDomains, ["'unsafe-inline'"]);
|
||||
|
||||
$this->allowedFrameDomains = \array_unique(\array_merge(
|
||||
$this->allowedFrameDomains,
|
||||
$CSP->frame
|
||||
));
|
||||
$this->allowedFrameDomains = \array_unique(\array_merge($this->allowedFrameDomains, $CSP->frame));
|
||||
|
||||
$this->reportTo = \array_unique(\array_merge(
|
||||
$this->reportTo,
|
||||
$CSP->report_to
|
||||
));
|
||||
$this->reportTo = \array_unique(\array_merge($this->reportTo, $CSP->report_to));
|
||||
}
|
||||
|
||||
public function getSnappyMailNonce() {
|
||||
|
|
|
|||
|
|
@ -51,8 +51,8 @@ class PageController extends Controller
|
|||
$oActions = $bAdmin ? new \RainLoop\ActionsAdmin() : \RainLoop\Api::Actions();
|
||||
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
||||
$oServiceActions = new \RainLoop\ServiceActions($oHttp, $oActions);
|
||||
$sAppJsMin = $oConfig->Get('labs', 'use_app_debug_js', false) ? '' : '.min';
|
||||
$sAppCssMin = $oConfig->Get('labs', 'use_app_debug_css', false) ? '' : '.min';
|
||||
$sAppJsMin = $oConfig->Get('debug', 'javascript', false) ? '' : '.min';
|
||||
$sAppCssMin = $oConfig->Get('debug', 'css', false) ? '' : '.min';
|
||||
$sLanguage = $oActions->GetLanguage(false);
|
||||
|
||||
$csp = new ContentSecurityPolicy();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue