summaryrefslogtreecommitdiffstats
path: root/lib/private/Security/CSP
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/Security/CSP')
-rw-r--r--lib/private/Security/CSP/ContentSecurityPolicy.php1
-rw-r--r--lib/private/Security/CSP/ContentSecurityPolicyManager.php6
-rw-r--r--lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php4
3 files changed, 5 insertions, 6 deletions
diff --git a/lib/private/Security/CSP/ContentSecurityPolicy.php b/lib/private/Security/CSP/ContentSecurityPolicy.php
index 4db1314e782..4d41bd56206 100644
--- a/lib/private/Security/CSP/ContentSecurityPolicy.php
+++ b/lib/private/Security/CSP/ContentSecurityPolicy.php
@@ -245,5 +245,4 @@ class ContentSecurityPolicy extends \OCP\AppFramework\Http\ContentSecurityPolicy
public function setReportTo(array $reportTo) {
$this->reportTo = $reportTo;
}
-
}
diff --git a/lib/private/Security/CSP/ContentSecurityPolicyManager.php b/lib/private/Security/CSP/ContentSecurityPolicyManager.php
index 9f1a480ccce..4245fdcb2de 100644
--- a/lib/private/Security/CSP/ContentSecurityPolicyManager.php
+++ b/lib/private/Security/CSP/ContentSecurityPolicyManager.php
@@ -59,7 +59,7 @@ class ContentSecurityPolicyManager implements IContentSecurityPolicyManager {
$this->dispatcher->dispatch(AddContentSecurityPolicyEvent::class, $event);
$defaultPolicy = new \OC\Security\CSP\ContentSecurityPolicy();
- foreach($this->policies as $policy) {
+ foreach ($this->policies as $policy) {
$defaultPolicy = $this->mergePolicies($defaultPolicy, $policy);
}
return $defaultPolicy;
@@ -74,9 +74,9 @@ class ContentSecurityPolicyManager implements IContentSecurityPolicyManager {
*/
public function mergePolicies(ContentSecurityPolicy $defaultPolicy,
EmptyContentSecurityPolicy $originalPolicy): ContentSecurityPolicy {
- foreach((object)(array)$originalPolicy as $name => $value) {
+ foreach ((object)(array)$originalPolicy as $name => $value) {
$setter = 'set'.ucfirst($name);
- if(\is_array($value)) {
+ if (\is_array($value)) {
$getter = 'get'.ucfirst($name);
$currentValues = \is_array($defaultPolicy->$getter()) ? $defaultPolicy->$getter() : [];
$defaultPolicy->$setter(array_values(array_unique(array_merge($currentValues, $value))));
diff --git a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
index 9dec2907b2f..06f8faece13 100644
--- a/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
+++ b/lib/private/Security/CSP/ContentSecurityPolicyNonceManager.php
@@ -61,7 +61,7 @@ class ContentSecurityPolicyNonceManager {
* @return string
*/
public function getNonce(): string {
- if($this->nonce === '') {
+ if ($this->nonce === '') {
if (empty($this->request->server['CSP_NONCE'])) {
$this->nonce = base64_encode($this->csrfTokenManager->getToken()->getEncryptedValue());
} else {
@@ -86,7 +86,7 @@ class ContentSecurityPolicyNonceManager {
'/^Mozilla\/5\.0 \([^)]+\) AppleWebKit\/[0-9.]+ \(KHTML, like Gecko\) Version\/(?:1[2-9]|[2-9][0-9])\.[0-9]+(?:\.[0-9]+)? Safari\/[0-9.A-Z]+$/',
];
- if($this->request->isUserAgent($browserWhitelist)) {
+ if ($this->request->isUserAgent($browserWhitelist)) {
return true;
}