summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2020-11-06 22:42:20 +0100
committerGitHub <noreply@github.com>2020-11-06 22:42:20 +0100
commitcab80e685b973c3e63b1d298873860eea862dc06 (patch)
tree6fe2a888d8df162ee49782d245a2dae6f9d7a4cb /lib/private
parent1da559f5e91a00dc872bc9072322a6a07f670750 (diff)
parent7e2c3a820ef5c5557558bd9df5f7384a65f8c6eb (diff)
downloadnextcloud-server-cab80e685b973c3e63b1d298873860eea862dc06.tar.gz
nextcloud-server-cab80e685b973c3e63b1d298873860eea862dc06.zip
Merge pull request #23942 from nextcloud/techdebt/cookie-lax-php7.3
Remove the cookie paths for php<7.3
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/AppFramework/Http/Output.php20
-rw-r--r--lib/private/Session/CryptoWrapper.php28
-rw-r--r--lib/private/Session/Internal.php6
3 files changed, 21 insertions, 33 deletions
diff --git a/lib/private/AppFramework/Http/Output.php b/lib/private/AppFramework/Http/Output.php
index 45d8d9b8c66..9f26d94b8aa 100644
--- a/lib/private/AppFramework/Http/Output.php
+++ b/lib/private/AppFramework/Http/Output.php
@@ -96,17 +96,13 @@ class Output implements IOutput {
public function setCookie($name, $value, $expire, $path, $domain, $secure, $httpOnly, $sameSite = 'Lax') {
$path = $this->webRoot ? : '/';
- if (PHP_VERSION_ID < 70300) {
- setcookie($name, $value, $expire, $path, $domain, $secure, $httpOnly);
- } else {
- setcookie($name, $value, [
- 'expires' => $expire,
- 'path' => $path,
- 'domain' => $domain,
- 'secure' => $secure,
- 'httponly' => $httpOnly,
- 'samesite' => $sameSite
- ]);
- }
+ setcookie($name, $value, [
+ 'expires' => $expire,
+ 'path' => $path,
+ 'domain' => $domain,
+ 'secure' => $secure,
+ 'httponly' => $httpOnly,
+ 'samesite' => $sameSite
+ ]);
}
}
diff --git a/lib/private/Session/CryptoWrapper.php b/lib/private/Session/CryptoWrapper.php
index f7f26bb10d2..0f791a865d8 100644
--- a/lib/private/Session/CryptoWrapper.php
+++ b/lib/private/Session/CryptoWrapper.php
@@ -88,22 +88,18 @@ class CryptoWrapper {
$webRoot = '/';
}
- if (PHP_VERSION_ID < 70300) {
- setcookie(self::COOKIE_NAME, $this->passphrase, 0, $webRoot, '', $secureCookie, true);
- } else {
- setcookie(
- self::COOKIE_NAME,
- $this->passphrase,
- [
- 'expires' => 0,
- 'path' => $webRoot,
- 'domain' => '',
- 'secure' => $secureCookie,
- 'httponly' => true,
- 'samesite' => 'Lax',
- ]
- );
- }
+ setcookie(
+ self::COOKIE_NAME,
+ $this->passphrase,
+ [
+ 'expires' => 0,
+ 'path' => $webRoot,
+ 'domain' => '',
+ 'secure' => $secureCookie,
+ 'httponly' => true,
+ 'samesite' => 'Lax',
+ ]
+ );
}
}
}
diff --git a/lib/private/Session/Internal.php b/lib/private/Session/Internal.php
index f08f4da52a7..b7e1c7b7bf8 100644
--- a/lib/private/Session/Internal.php
+++ b/lib/private/Session/Internal.php
@@ -214,10 +214,6 @@ class Internal extends Session {
}
private function startSession(bool $silence = false) {
- if (PHP_VERSION_ID < 70300) {
- $this->invoke('session_start', [], $silence);
- } else {
- $this->invoke('session_start', [['cookie_samesite' => 'Lax']], $silence);
- }
+ $this->invoke('session_start', [['cookie_samesite' => 'Lax']], $silence);
}
}