From 7ebbb6b2ca52e122adfca88e4b9a2805863e43d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 7 Nov 2022 10:54:02 +0100 Subject: [PATCH] Remove workarounds specific to 7.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/encryption/lib/Crypto/Crypt.php | 7 +++---- apps/settings/lib/Controller/CheckSetupController.php | 2 +- tests/lib/Files/Type/DetectionTest.php | 2 +- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/encryption/lib/Crypto/Crypt.php b/apps/encryption/lib/Crypto/Crypt.php index 8bfeb0c7a68..efb5a6868b0 100644 --- a/apps/encryption/lib/Crypto/Crypt.php +++ b/apps/encryption/lib/Crypto/Crypt.php @@ -316,8 +316,8 @@ class Crypt { throw new \InvalidArgumentException( sprintf( - 'Unsupported cipher (%s) defined.', - $cipher + 'Unsupported cipher (%s) defined.', + $cipher ) ); } @@ -470,8 +470,7 @@ class Crypt { */ protected function isValidPrivateKey($plainKey) { $res = openssl_get_privatekey($plainKey); - // TODO: remove resource check one php7.4 is not longer supported - if (is_resource($res) || (is_object($res) && get_class($res) === 'OpenSSLAsymmetricKey')) { + if (is_object($res) && get_class($res) === 'OpenSSLAsymmetricKey') { $sslInfo = openssl_pkey_get_details($res); if (isset($sslInfo['key'])) { return true; diff --git a/apps/settings/lib/Controller/CheckSetupController.php b/apps/settings/lib/Controller/CheckSetupController.php index 45e94c3b7a7..eaaacc3fd22 100644 --- a/apps/settings/lib/Controller/CheckSetupController.php +++ b/apps/settings/lib/Controller/CheckSetupController.php @@ -722,7 +722,7 @@ Raw output $recommendedPHPModules[] = 'sysvsem'; } - if (!defined('PASSWORD_ARGON2I') && PHP_VERSION_ID >= 70400) { + if (!defined('PASSWORD_ARGON2I')) { // Installing php-sodium on >=php7.4 will provide PASSWORD_ARGON2I // on previous version argon2 wasn't part of the "standard" extension // and RedHat disabled it so even installing php-sodium won't provide argon2i diff --git a/tests/lib/Files/Type/DetectionTest.php b/tests/lib/Files/Type/DetectionTest.php index 568dbb0cf56..d2fdb18e26d 100644 --- a/tests/lib/Files/Type/DetectionTest.php +++ b/tests/lib/Files/Type/DetectionTest.php @@ -71,7 +71,7 @@ class DetectionTest extends \Test\TestCase { public function dataDetectContent(): array { return [ ['/', 'httpd/unix-directory'], - // ['/data.tar.gz', 'application/x-gzip'], TODO: fix as it fails hard on php7.4 now + ['/data.tar.gz', 'application/x-gzip'], ['/data.zip', 'application/zip'], ['/testimage.mp3', 'audio/mpeg'], ['/testimage.png', 'image/png'],