diff --git a/classes/Cookie.php b/classes/Cookie.php index 87f09bf60ba68..e74a76d38b744 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -380,22 +380,6 @@ protected function encryptAndSetCookie($cookie = null) throw new PrestaShopException('Error during setting a cookie. Combined size of name and value cannot exceed 4096 characters. Larger cookie is not compliant with RFC 2965 and will not be accepted by the browser.'); } - /* - * The alternative signature supporting an options array is only available since - * PHP 7.3.0, before there is no support for SameSite attribute. - */ - if (PHP_VERSION_ID < 70300) { - return setcookie( - $this->_name, - $content, - $time, - $this->_path, - $this->_domain . '; SameSite=' . $this->_sameSite, - $this->_secure, - true - ); - } - return setcookie( $this->_name, $content, diff --git a/classes/db/Db.php b/classes/db/Db.php index 29ae0f9b7e633..78ffc6f32a58d 100644 --- a/classes/db/Db.php +++ b/classes/db/Db.php @@ -297,7 +297,7 @@ public static function getClass() { $class = ''; /* @phpstan-ignore-next-line */ - if (PHP_VERSION_ID >= 50200 && extension_loaded('pdo_mysql')) { + if (extension_loaded('pdo_mysql')) { $class = 'DbPDO'; } elseif (extension_loaded('mysqli')) { $class = 'DbMySQLi'; diff --git a/src/Core/Session/SessionHandler.php b/src/Core/Session/SessionHandler.php index c4b9e7423e9e6..e2af69ad0311e 100644 --- a/src/Core/Session/SessionHandler.php +++ b/src/Core/Session/SessionHandler.php @@ -95,27 +95,13 @@ public function init(): void return; } - /* - * The alternative signature supporting an options array is only available since - * PHP 7.3.0, before there is no support for SameSite attribute. - */ - if (PHP_VERSION_ID < 70300) { - session_set_cookie_params( - $this->lifetime, - $this->path . ';SameSite=' . $this->sameSite, - '', - $this->isSecure, - true - ); - } else { - session_set_cookie_params([ - 'lifetime' => $this->lifetime, - 'path' => $this->path, - 'secure' => $this->isSecure, - 'httponly' => true, - 'samesite' => $this->sameSite, - ]); - } + session_set_cookie_params([ + 'lifetime' => $this->lifetime, + 'path' => $this->path, + 'secure' => $this->isSecure, + 'httponly' => true, + 'samesite' => $this->sameSite, + ]); $this->session = new Session(new PhpBridgeSessionStorage()); $this->session->start();