Skip to content

Commit

Permalink
Throw Exception in unique_key() if random_int() is missing
Browse files Browse the repository at this point in the history
  • Loading branch information
frankiejarrett committed Aug 4, 2017
1 parent c640f28 commit d547f2f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Config_Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,9 +366,15 @@ private function return_constant_or_global( $assoc_args, $get_constant, $wp_conf
/**
* Generate a unique key/salt for the wp-config.php file.
*
* @throws Exception
*
* @return string
*/
private static function unique_key() {
if ( ! function_exists( 'random_int' ) ) {
throw new Exception( "'random_int' does not exist" );
}

$chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
$key = '';

Expand Down

0 comments on commit d547f2f

Please sign in to comment.