Permalink
Browse files

Change MCrypt test for either Mcrypt or OpenSSL - Fix #1233

  • Loading branch information...
1 parent d0f2120 commit e8c76b4f98e0d3ab3d37013cb6849b40316a6c9b @cdujeu cdujeu committed Oct 7, 2016
Showing with 5 additions and 5 deletions.
  1. +5 −5 core/src/core/src/pydio/Tests/{PHPMCrypt.php → CryptoFunctions.php}
@@ -26,25 +26,25 @@
* Check whether mcrypt is enabled
* @package Pydio\Tests
*/
-class PHPMCrypt extends AbstractTest
+class CryptoFunctions extends AbstractTest
{
/**
* @inheritdoc
*/
- public function __construct() { parent::__construct("MCrypt enabled", "MCrypt is required by all security functions."); }
+ public function __construct() { parent::__construct("Crypto Extensions", "Either OpenSSL or MCrypt are required by internal security functions."); }
/**
* @inheritdoc
*/
public function doTest()
{
$this->failedLevel = "error";
- if (!function_exists("mcrypt_create_iv")) {
- $this->testedParams["MCrypt Enabled"] = "No";
+ if (!function_exists("openssl_encrypt") && !function_exists("mcrypt_create_iv")) {
+ $this->testedParams["OpenSSL or MCrypt Detected"] = "No";
return FALSE;
}
- $this->testedParams["MCrypt Enabled"] = "Yes";
+ $this->testedParams["Crypto Extension Detected"] = function_exists("openssl_encrypt") ? "OpenSSL" : "MCrypt";
return TRUE;
}
}

0 comments on commit e8c76b4

Please sign in to comment.