@@ -559,7 +559,7 @@ |
||
559 | 559 | } |
560 | 560 | $data = urldecode($data); |
561 | 561 | |
562 | - $data = preg_replace_callback('/(?:^|(?<=&))[^=[]+/', function ($match) { |
|
562 | + $data = preg_replace_callback('/(?:^|(?<=&))[^=[]+/', function($match) { |
|
563 | 563 | return bin2hex(urldecode($match[0])); |
564 | 564 | }, $data); |
565 | 565 |
@@ -143,7 +143,7 @@ |
||
143 | 143 | // Firefox doesn't report the disposition. |
144 | 144 | return 'unknown'; |
145 | 145 | } |
146 | - return ; |
|
146 | + return; |
|
147 | 147 | case self::BLOCKED_URI: |
148 | 148 | return $cspReport['blocked-uri']; |
149 | 149 | case self::EFFECTIVE_DIRECTIVE: |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | ], |
100 | 100 | ], |
101 | 101 | ], |
102 | - function () use ($testURI) { |
|
102 | + function() use ($testURI) { |
|
103 | 103 | $defaultUri = Director::absoluteURL(SecurityHeaderMiddleware::config()->get('report_uri')); |
104 | 104 | $response = $this->getResponse(); |
105 | 105 | $csp = $response->getHeader('Content-Security-Policy'); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | 'use_report_to' => true, |
130 | 130 | ], |
131 | 131 | ], |
132 | - function () { |
|
132 | + function() { |
|
133 | 133 | $response = $this->getResponse(); |
134 | 134 | $csp = $response->getHeader('Content-Security-Policy'); |
135 | 135 | $reportHeaderExists = $response->getHeader('Report-To') !== null; |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | 'use_report_to' => true, |
175 | 175 | ], |
176 | 176 | ], |
177 | - function () { |
|
177 | + function() { |
|
178 | 178 | $defaultEndpoint = SecurityHeaderMiddleware::config()->get('report_to_group'); |
179 | 179 | $defaultUri = Director::absoluteURL(SecurityHeaderMiddleware::config()->get('report_uri')); |
180 | 180 | $response = $this->getResponse(); |
@@ -56,8 +56,7 @@ |
||
56 | 56 | $report->delete(); |
57 | 57 | $delta++; |
58 | 58 | } |
59 | - } |
|
60 | - finally { |
|
59 | + } finally { |
|
61 | 60 | DB::get_conn()->transactionEnd(); |
62 | 61 | } |
63 | 62 |
@@ -49,8 +49,7 @@ |
||
49 | 49 | } |
50 | 50 | ++$delta; |
51 | 51 | } |
52 | - } |
|
53 | - finally { |
|
52 | + } finally { |
|
54 | 53 | DB::get_conn()->transactionEnd(); |
55 | 54 | } |
56 | 55 |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | 'max_age' => 1800, |
213 | 213 | 'endpoints' => [[ |
214 | 214 | 'url' => $this->getReportURI(), |
215 | - ],], |
|
215 | + ], ], |
|
216 | 216 | 'include_subdomains' => $this->getIncludeSubdomains(), |
217 | 217 | ]; |
218 | 218 | return json_encode($header); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | { |
223 | 223 | if ($this->isReporting()) { |
224 | 224 | // Add or update report-uri directive. |
225 | - if($cspHeader) { |
|
225 | + if ($cspHeader) { |
|
226 | 226 | if (strpos($cspHeader, 'report-uri')) { |
227 | 227 | $cspHeader = str_replace('report-uri', $this->getReportURIDirective(), $cspHeader); |
228 | 228 | } else { |
@@ -228,8 +228,7 @@ |
||
228 | 228 | } else { |
229 | 229 | $cspHeader = rtrim($cspHeader, ';') . "; {$this->getReportURIDirective()};"; |
230 | 230 | } |
231 | - } |
|
232 | - else { |
|
231 | + } else { |
|
233 | 232 | $cspHeader = $this->getReportURIDirective() . ';'; |
234 | 233 | } |
235 | 234 | // Add report-to directive. |