@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | static public function enableCaching($cache_time = null) { |
49 | 49 | if (is_numeric($cache_time)) { |
50 | - header('Pragma: public');// enable caching in IE |
|
50 | + header('Pragma: public'); // enable caching in IE |
|
51 | 51 | if ($cache_time > 0) { |
52 | 52 | self::setExpiresHeader('PT'.$cache_time.'S'); |
53 | 53 | header('Cache-Control: max-age='.$cache_time.', must-revalidate'); |
@@ -78,29 +78,29 @@ discard block |
||
78 | 78 | */ |
79 | 79 | static public function setStatus($status) { |
80 | 80 | $protocol = \OC::$server->getRequest()->getHttpProtocol(); |
81 | - switch($status) { |
|
81 | + switch ($status) { |
|
82 | 82 | case self::STATUS_NOT_MODIFIED: |
83 | - $status = $status . ' Not Modified'; |
|
83 | + $status = $status.' Not Modified'; |
|
84 | 84 | break; |
85 | 85 | case self::STATUS_TEMPORARY_REDIRECT: |
86 | 86 | if ($protocol == 'HTTP/1.1') { |
87 | - $status = $status . ' Temporary Redirect'; |
|
87 | + $status = $status.' Temporary Redirect'; |
|
88 | 88 | break; |
89 | 89 | } else { |
90 | 90 | $status = self::STATUS_FOUND; |
91 | 91 | // fallthrough |
92 | 92 | } |
93 | 93 | case self::STATUS_FOUND; |
94 | - $status = $status . ' Found'; |
|
94 | + $status = $status.' Found'; |
|
95 | 95 | break; |
96 | 96 | case self::STATUS_NOT_FOUND; |
97 | - $status = $status . ' Not Found'; |
|
97 | + $status = $status.' Not Found'; |
|
98 | 98 | break; |
99 | 99 | case self::STATUS_INTERNAL_SERVER_ERROR; |
100 | - $status = $status . ' Internal Server Error'; |
|
100 | + $status = $status.' Internal Server Error'; |
|
101 | 101 | break; |
102 | 102 | case self::STATUS_SERVICE_UNAVAILABLE; |
103 | - $status = $status . ' Service Unavailable'; |
|
103 | + $status = $status.' Service Unavailable'; |
|
104 | 104 | break; |
105 | 105 | } |
106 | 106 | header($protocol.' '.$status); |
@@ -180,17 +180,17 @@ discard block |
||
180 | 180 | * @param string $filename file name |
181 | 181 | * @param string $type disposition type, either 'attachment' or 'inline' |
182 | 182 | */ |
183 | - static public function setContentDispositionHeader( $filename, $type = 'attachment' ) { |
|
183 | + static public function setContentDispositionHeader($filename, $type = 'attachment') { |
|
184 | 184 | if (\OC::$server->getRequest()->isUserAgent( |
185 | 185 | [ |
186 | 186 | \OC\AppFramework\Http\Request::USER_AGENT_IE, |
187 | 187 | \OC\AppFramework\Http\Request::USER_AGENT_ANDROID_MOBILE_CHROME, |
188 | 188 | \OC\AppFramework\Http\Request::USER_AGENT_FREEBOX, |
189 | 189 | ])) { |
190 | - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename="' . rawurlencode( $filename ) . '"' ); |
|
190 | + header('Content-Disposition: '.rawurlencode($type).'; filename="'.rawurlencode($filename).'"'); |
|
191 | 191 | } else { |
192 | - header( 'Content-Disposition: ' . rawurlencode($type) . '; filename*=UTF-8\'\'' . rawurlencode( $filename ) |
|
193 | - . '; filename="' . rawurlencode( $filename ) . '"' ); |
|
192 | + header('Content-Disposition: '.rawurlencode($type).'; filename*=UTF-8\'\''.rawurlencode($filename) |
|
193 | + . '; filename="'.rawurlencode($filename).'"'); |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | . 'font-src \'self\' data:; ' |
255 | 255 | . 'media-src *; ' |
256 | 256 | . 'connect-src *'; |
257 | - header('Content-Security-Policy:' . $policy); |
|
257 | + header('Content-Security-Policy:'.$policy); |
|
258 | 258 | header('X-Frame-Options: Sameorigin'); // Disallow iFraming from other domains |
259 | 259 | |
260 | 260 | // Send fallback headers for installations that don't have the possibility to send |
261 | 261 | // custom headers on the webserver side |
262 | - if(getenv('modHeadersAvailable') !== 'true') { |
|
262 | + if (getenv('modHeadersAvailable') !== 'true') { |
|
263 | 263 | header('X-XSS-Protection: 1; mode=block'); // Enforce browser based XSS filters |
264 | 264 | header('X-Content-Type-Options: nosniff'); // Disable sniffing the content type for IE |
265 | 265 | header('X-Robots-Tag: none'); // https://developers.google.com/webmasters/control-crawl-index/docs/robots_meta_tag |