mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-07 00:17:03 +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() {
|
function __construct() {
|
||||||
$CSP = \RainLoop\Api::getCSP();
|
$CSP = \RainLoop\Api::getCSP();
|
||||||
|
|
||||||
$this->allowedScriptDomains = \array_unique(\array_merge(
|
$this->allowedScriptDomains = \array_unique(\array_merge($this->allowedScriptDomains, $CSP->script));
|
||||||
$this->allowedScriptDomains,
|
|
||||||
$CSP->script
|
|
||||||
));
|
|
||||||
$this->allowedScriptDomains = \array_diff($this->allowedScriptDomains, ["'unsafe-inline'", "'unsafe-eval'"]);
|
$this->allowedScriptDomains = \array_diff($this->allowedScriptDomains, ["'unsafe-inline'", "'unsafe-eval'"]);
|
||||||
|
|
||||||
// Nextcloud only sets 'strict-dynamic' when browserSupportsCspV3() ?
|
// Nextcloud only sets 'strict-dynamic' when browserSupportsCspV3() ?
|
||||||
|
|
@ -27,26 +24,14 @@ class ContentSecurityPolicy extends \OCP\AppFramework\Http\ContentSecurityPolicy
|
||||||
? $this->useStrictDynamic(true) // NC24+
|
? $this->useStrictDynamic(true) // NC24+
|
||||||
: $this->addAllowedScriptDomain("'strict-dynamic'");
|
: $this->addAllowedScriptDomain("'strict-dynamic'");
|
||||||
|
|
||||||
$this->allowedImageDomains = \array_unique(\array_merge(
|
$this->allowedImageDomains = \array_unique(\array_merge($this->allowedImageDomains, $CSP->img));
|
||||||
$this->allowedImageDomains,
|
|
||||||
$CSP->img
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->allowedStyleDomains = \array_unique(\array_merge(
|
$this->allowedStyleDomains = \array_unique(\array_merge($this->allowedStyleDomains, $CSP->style));
|
||||||
$this->allowedStyleDomains,
|
|
||||||
$CSP->style
|
|
||||||
));
|
|
||||||
$this->allowedStyleDomains = \array_diff($this->allowedStyleDomains, ["'unsafe-inline'"]);
|
$this->allowedStyleDomains = \array_diff($this->allowedStyleDomains, ["'unsafe-inline'"]);
|
||||||
|
|
||||||
$this->allowedFrameDomains = \array_unique(\array_merge(
|
$this->allowedFrameDomains = \array_unique(\array_merge($this->allowedFrameDomains, $CSP->frame));
|
||||||
$this->allowedFrameDomains,
|
|
||||||
$CSP->frame
|
|
||||||
));
|
|
||||||
|
|
||||||
$this->reportTo = \array_unique(\array_merge(
|
$this->reportTo = \array_unique(\array_merge($this->reportTo, $CSP->report_to));
|
||||||
$this->reportTo,
|
|
||||||
$CSP->report_to
|
|
||||||
));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getSnappyMailNonce() {
|
public function getSnappyMailNonce() {
|
||||||
|
|
|
||||||
|
|
@ -51,8 +51,8 @@ class PageController extends Controller
|
||||||
$oActions = $bAdmin ? new \RainLoop\ActionsAdmin() : \RainLoop\Api::Actions();
|
$oActions = $bAdmin ? new \RainLoop\ActionsAdmin() : \RainLoop\Api::Actions();
|
||||||
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
$oHttp = \MailSo\Base\Http::SingletonInstance();
|
||||||
$oServiceActions = new \RainLoop\ServiceActions($oHttp, $oActions);
|
$oServiceActions = new \RainLoop\ServiceActions($oHttp, $oActions);
|
||||||
$sAppJsMin = $oConfig->Get('labs', 'use_app_debug_js', false) ? '' : '.min';
|
$sAppJsMin = $oConfig->Get('debug', 'javascript', false) ? '' : '.min';
|
||||||
$sAppCssMin = $oConfig->Get('labs', 'use_app_debug_css', false) ? '' : '.min';
|
$sAppCssMin = $oConfig->Get('debug', 'css', false) ? '' : '.min';
|
||||||
$sLanguage = $oActions->GetLanguage(false);
|
$sLanguage = $oActions->GetLanguage(false);
|
||||||
|
|
||||||
$csp = new ContentSecurityPolicy();
|
$csp = new ContentSecurityPolicy();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue