Skip to content

Commit

Permalink
Merge pull request #48 from WordPress-Phoenix/fixes/fixing-compat-issue
Browse files Browse the repository at this point in the history
Fixing PHPCompatibilityWP issues for mcrypt_decrypt
  • Loading branch information
johnciacia authored Feb 5, 2021
2 parents b45fc48 + 3363e50 commit fc129e2
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/class-wordpress-options-panels.php
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
*
* @authors 🌵 WordPress Phoenix 🌵 / Seth Carstens, David Ryan
* @package wpop
* @version 5.0.4
* @version 5.0.5
* @license GPL-2.0+ - please retain comments that express original build of this file by the author.
*/

7 changes: 6 additions & 1 deletion src/inc/api/class-mcrypt.php
Original file line number Diff line number Diff line change
@@ -58,8 +58,13 @@ public static function pad_key( $key ) {
* @return string
*/
public static function upgrade_mcrypt_option( $encrypted_string ) {
// mcrypt was removed in PHP 7.2.
if ( version_compare( phpversion(), '7.2', '>=' ) ) {
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' ) );
}

// If we cannot successfully decrypt, try falling back to mcrypt and re-encrypting.
$result = static::mcrypt_decrypt( $encrypted_string );
$result = static::mcrypt_decrypt( $encrypted_string ); // @codingStandardsIgnoreLine | // mcrypt was removed in PHP 7.2.

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

0 comments on commit fc129e2

Please sign in to comment.