@@ -41,58 +41,58 @@ |
||
| 41 | 41 | * @since 8.1.0 |
| 42 | 42 | */ |
| 43 | 43 | class ContentSecurityPolicy extends EmptyContentSecurityPolicy { |
| 44 | - /** @var bool Whether inline JS snippets are allowed */ |
|
| 45 | - protected $inlineScriptAllowed = false; |
|
| 46 | - /** @var bool Whether eval in JS scripts is allowed */ |
|
| 47 | - protected $evalScriptAllowed = false; |
|
| 48 | - /** @var array Domains from which scripts can get loaded */ |
|
| 49 | - protected $allowedScriptDomains = [ |
|
| 50 | - '\'self\'', |
|
| 51 | - ]; |
|
| 52 | - /** |
|
| 53 | - * @var bool Whether inline CSS is allowed |
|
| 54 | - * TODO: Disallow per default |
|
| 55 | - * @link https://github.com/owncloud/core/issues/13458 |
|
| 56 | - */ |
|
| 57 | - protected $inlineStyleAllowed = true; |
|
| 58 | - /** @var array Domains from which CSS can get loaded */ |
|
| 59 | - protected $allowedStyleDomains = [ |
|
| 60 | - '\'self\'', |
|
| 61 | - ]; |
|
| 62 | - /** @var array Domains from which images can get loaded */ |
|
| 63 | - protected $allowedImageDomains = [ |
|
| 64 | - '\'self\'', |
|
| 65 | - 'data:', |
|
| 66 | - 'blob:', |
|
| 67 | - ]; |
|
| 68 | - /** @var array Domains to which connections can be done */ |
|
| 69 | - protected $allowedConnectDomains = [ |
|
| 70 | - '\'self\'', |
|
| 71 | - ]; |
|
| 72 | - /** @var array Domains from which media elements can be loaded */ |
|
| 73 | - protected $allowedMediaDomains = [ |
|
| 74 | - '\'self\'', |
|
| 75 | - ]; |
|
| 76 | - /** @var array Domains from which object elements can be loaded */ |
|
| 77 | - protected $allowedObjectDomains = []; |
|
| 78 | - /** @var array Domains from which iframes can be loaded */ |
|
| 79 | - protected $allowedFrameDomains = []; |
|
| 80 | - /** @var array Domains from which fonts can be loaded */ |
|
| 81 | - protected $allowedFontDomains = [ |
|
| 82 | - '\'self\'', |
|
| 83 | - 'data:', |
|
| 84 | - ]; |
|
| 85 | - /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
| 86 | - protected $allowedChildSrcDomains = []; |
|
| 44 | + /** @var bool Whether inline JS snippets are allowed */ |
|
| 45 | + protected $inlineScriptAllowed = false; |
|
| 46 | + /** @var bool Whether eval in JS scripts is allowed */ |
|
| 47 | + protected $evalScriptAllowed = false; |
|
| 48 | + /** @var array Domains from which scripts can get loaded */ |
|
| 49 | + protected $allowedScriptDomains = [ |
|
| 50 | + '\'self\'', |
|
| 51 | + ]; |
|
| 52 | + /** |
|
| 53 | + * @var bool Whether inline CSS is allowed |
|
| 54 | + * TODO: Disallow per default |
|
| 55 | + * @link https://github.com/owncloud/core/issues/13458 |
|
| 56 | + */ |
|
| 57 | + protected $inlineStyleAllowed = true; |
|
| 58 | + /** @var array Domains from which CSS can get loaded */ |
|
| 59 | + protected $allowedStyleDomains = [ |
|
| 60 | + '\'self\'', |
|
| 61 | + ]; |
|
| 62 | + /** @var array Domains from which images can get loaded */ |
|
| 63 | + protected $allowedImageDomains = [ |
|
| 64 | + '\'self\'', |
|
| 65 | + 'data:', |
|
| 66 | + 'blob:', |
|
| 67 | + ]; |
|
| 68 | + /** @var array Domains to which connections can be done */ |
|
| 69 | + protected $allowedConnectDomains = [ |
|
| 70 | + '\'self\'', |
|
| 71 | + ]; |
|
| 72 | + /** @var array Domains from which media elements can be loaded */ |
|
| 73 | + protected $allowedMediaDomains = [ |
|
| 74 | + '\'self\'', |
|
| 75 | + ]; |
|
| 76 | + /** @var array Domains from which object elements can be loaded */ |
|
| 77 | + protected $allowedObjectDomains = []; |
|
| 78 | + /** @var array Domains from which iframes can be loaded */ |
|
| 79 | + protected $allowedFrameDomains = []; |
|
| 80 | + /** @var array Domains from which fonts can be loaded */ |
|
| 81 | + protected $allowedFontDomains = [ |
|
| 82 | + '\'self\'', |
|
| 83 | + 'data:', |
|
| 84 | + ]; |
|
| 85 | + /** @var array Domains from which web-workers and nested browsing content can load elements */ |
|
| 86 | + protected $allowedChildSrcDomains = []; |
|
| 87 | 87 | |
| 88 | - /** @var array Domains which can embed this Nextcloud instance */ |
|
| 89 | - protected $allowedFrameAncestors = [ |
|
| 90 | - '\'self\'', |
|
| 91 | - ]; |
|
| 88 | + /** @var array Domains which can embed this Nextcloud instance */ |
|
| 89 | + protected $allowedFrameAncestors = [ |
|
| 90 | + '\'self\'', |
|
| 91 | + ]; |
|
| 92 | 92 | |
| 93 | - /** @var array Domains from which web-workers can be loaded */ |
|
| 94 | - protected $allowedWorkerSrcDomains = []; |
|
| 93 | + /** @var array Domains from which web-workers can be loaded */ |
|
| 94 | + protected $allowedWorkerSrcDomains = []; |
|
| 95 | 95 | |
| 96 | - /** @var array Locations to report violations to */ |
|
| 97 | - protected $reportTo = []; |
|
| 96 | + /** @var array Locations to report violations to */ |
|
| 97 | + protected $reportTo = []; |
|
| 98 | 98 | } |