Skip to content

Commit 933c36d

Browse files
Merge pull request #51184 from nextcloud/backport/51173/master
[master] Fix A+ rating when checking with Nextcloud Security Scan.
2 parents 0717412 + e1e0b68 commit 933c36d

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

lib/base.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -363,13 +363,6 @@ private static function printUpgradePage(\OC\SystemConfig $systemConfig): void {
363363
public static function initSession(): void {
364364
$request = Server::get(IRequest::class);
365365

366-
// Do not initialize sessions for 'status.php' requests
367-
// Monitoring endpoints can quickly flood session handlers
368-
// and 'status.php' doesn't require sessions anyway
369-
if (str_ends_with($request->getScriptName(), '/status.php')) {
370-
return;
371-
}
372-
373366
// TODO: Temporary disabled again to solve issues with CalDAV/CardDAV clients like DAVx5 that use cookies
374367
// TODO: See https://github.com/nextcloud/server/issues/37277#issuecomment-1476366147 and the other comments
375368
// TODO: for further information.
@@ -388,6 +381,13 @@ public static function initSession(): void {
388381
// prevents javascript from accessing php session cookies
389382
ini_set('session.cookie_httponly', 'true');
390383

384+
// Do not initialize sessions for 'status.php' requests
385+
// Monitoring endpoints can quickly flood session handlers
386+
// and 'status.php' doesn't require sessions anyway
387+
if (str_ends_with($request->getScriptName(), '/status.php')) {
388+
return;
389+
}
390+
391391
// set the cookie path to the Nextcloud directory
392392
$cookie_path = OC::$WEBROOT ? : '/';
393393
ini_set('session.cookie_path', $cookie_path);

0 commit comments

Comments
 (0)