Skip to content

Commit

Permalink
Merge pull request #47 from WordPress-Phoenix/fixes/fixing-wpcs-issues
Browse files Browse the repository at this point in the history
Coding Standards Issue
  • Loading branch information
scarstens authored Feb 5, 2021
2 parents d554d65 + 342fbd2 commit b45fc48
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/class-wordpress-options-panels.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*
* @authors 🌵 WordPress Phoenix 🌵 / Seth Carstens, David Ryan
* @package wpop
* @version 5.0.3
* @version 5.0.4
* @license GPL-2.0+ - please retain comments that express original build of this file by the author.
*/

Expand Down
7 changes: 7 additions & 0 deletions src/inc/api/class-mcrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ public static function upgrade_mcrypt_option( $encrypted_string ) {
* @return string
*/
public static function mcrypt_decrypt( $encrypted_string ) {
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' ) );
}

// Throws errors depending on version of PHP. Added the catch above to account for this.
// @codingStandardsIgnoreStart
return trim(
mcrypt_decrypt(
MCRYPT_RIJNDAEL_256,
Expand All @@ -92,6 +98,7 @@ public static function mcrypt_decrypt( $encrypted_string ) {
MCRYPT_MODE_ECB
)
);
// @codingStandardsIgnoreEnd
}

}

0 comments on commit b45fc48

Please sign in to comment.