Skip to content

Commit fc129e2

Browse files
authored
Merge pull request #48 from WordPress-Phoenix/fixes/fixing-compat-issue
Fixing PHPCompatibilityWP issues for mcrypt_decrypt
2 parents b45fc48 + 3363e50 commit fc129e2

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

src/class-wordpress-options-panels.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* @authors 🌵 WordPress Phoenix 🌵 / Seth Carstens, David Ryan
66
* @package wpop
7-
* @version 5.0.4
7+
* @version 5.0.5
88
* @license GPL-2.0+ - please retain comments that express original build of this file by the author.
99
*/
1010

src/inc/api/class-mcrypt.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,13 @@ public static function pad_key( $key ) {
5858
* @return string
5959
*/
6060
public static function upgrade_mcrypt_option( $encrypted_string ) {
61+
// mcrypt was removed in PHP 7.2.
62+
if ( version_compare( phpversion(), '7.2', '>=' ) ) {
63+
return new \WP_Error( 'php_version', __( 'PHP version is to low to support mcrypt_decrypt. This function has been DEPRECATED as of PHP 7.1.0 and REMOVED as of PHP 7.2.0. Relying on this function is highly discouraged.', 'wpop' ) );
64+
}
65+
6166
// If we cannot successfully decrypt, try falling back to mcrypt and re-encrypting.
62-
$result = static::mcrypt_decrypt( $encrypted_string );
67+
$result = static::mcrypt_decrypt( $encrypted_string ); // @codingStandardsIgnoreLine | // mcrypt was removed in PHP 7.2.
6368

6469
// Could not decrypt; return nothing.
6570
if ( false === $result ) {

0 commit comments

Comments
 (0)