summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIvan Tcholakov <ivantcholakov@gmail.com>2016-08-27 20:30:34 +0300
committerIvan Tcholakov <ivantcholakov@gmail.com>2016-08-27 20:30:34 +0300
commit619086f2ced3f13975db2b7c65143e15a0b9f9a7 (patch)
treecd7f440fc0dbc89af62d8573ae6550c3a6fd2cbb
parentace073413d4a6381dce6c2930f94b61cec73f1f5 (diff)
downloadgibberish-aes-php-master.zip
gibberish-aes-php-master.tar.gz
gibberish-aes-php-master.tar.bz2
Signed-off-by:Ivan Tcholakov <ivantcholakov@gmail.com>
-rw-r--r--GibberishAES.php12
-rw-r--r--README.markdown2
2 files changed, 10 insertions, 4 deletions
diff --git a/GibberishAES.php b/GibberishAES.php
index 12d1d8a..4e8df5c 100644
--- a/GibberishAES.php
+++ b/GibberishAES.php
@@ -16,7 +16,7 @@
*
* OpenSSL functions installed and PHP version >= 5.3.3
* or
- * Mcrypt functions installed.
+ * Mcrypt functions installed and PHP version < 7.1.0-alpha
*
* For PHP under version 7 it is recommendable you to install within your project
* "PHP 5.x support for random_bytes() and random_int()",
@@ -51,7 +51,7 @@
* @author Ivan Tcholakov <ivantcholakov@gmail.com>, 2012-2016.
* Code repository: @link https://github.com/ivantcholakov/gibberish-aes-php
*
- * @version 1.3.0
+ * @version 1.3.1
*
* @license The MIT License (MIT)
* @link http://opensource.org/licenses/MIT
@@ -249,7 +249,13 @@ class GibberishAES {
protected static function mcrypt_exists() {
if (!isset(self::$mcrypt_exists)) {
- self::$mcrypt_exists = function_exists('mcrypt_encrypt');
+
+ if (version_compare(PHP_VERSION, '7.1.0-alpha', '>=')) {
+ // Avoid using mcrypt on PHP 7.1.x since deprecation notices are thrown.
+ self::$mcrypt_exists = false;
+ } else {
+ self::$mcrypt_exists = function_exists('mcrypt_encrypt');
+ }
}
return self::$mcrypt_exists;
diff --git a/README.markdown b/README.markdown
index 7d914c0..26a72ff 100644
--- a/README.markdown
+++ b/README.markdown
@@ -22,7 +22,7 @@ Requirements:
or
-- Mcrypt functions installed.
+- Mcrypt functions installed and PHP version < 7.1.0-alpha
For PHP under version 7 it is recommendable you to install within your project
"PHP 5.x support for random_bytes() and random_int()",