]> source.dussan.org Git - nextcloud-server.git/commitdiff
Remove the cookie paths for php<7.3 23942/head
authorChristoph Wurst <christoph@winzerhof-wurst.at>
Fri, 6 Nov 2020 14:57:17 +0000 (15:57 +0100)
committerChristoph Wurst <christoph@winzerhof-wurst.at>
Fri, 6 Nov 2020 14:57:17 +0000 (15:57 +0100)
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
lib/private/AppFramework/Http/Output.php
lib/private/Session/CryptoWrapper.php
lib/private/Session/Internal.php

index 45d8d9b8c66ceb13ccbc09b8d607ec4c614f80c0..9f26d94b8aa26d39bdd3d4bb205697119a1c9dd9 100644 (file)
@@ -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
+               ]);
        }
 }
index f7f26bb10d29ad034cf9c2602c1625c954802614..0f791a865d86685e187f245eb7eca622cbdff765 100644 (file)
@@ -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',
+                                       ]
+                               );
                        }
                }
        }
index f08f4da52a7abe2f9eb925d7a372e97c2c859011..b7e1c7b7bf87e7409fba2e561af60f03ea75f443 100644 (file)
@@ -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);
        }
 }