Skip to content

Commit 92bbcad

Browse files
Merge pull request #51173 from DaleBCooper/fix-a+-rating
Fix A+ rating when checking with Nextcloud Security Scan.
2 parents 043f0e6 + ed15fdf commit 92bbcad

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/base.php

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

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

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

0 commit comments

Comments
 (0)