From da19acbc4b0a50df5cd298d094c5152a381e47a6 Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Fri, 22 Feb 2008 17:36:09 +0000 Subject: [PATCH] Allow overriding the default secret key. Proy. Props nbachiyski. fixes #5960 git-svn-id: https://develop.svn.wordpress.org/trunk@6982 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/pluggable.php | 4 ++-- wp-settings.php | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/wp-includes/pluggable.php b/wp-includes/pluggable.php index bac66d23fd..02a31d52f1 100644 --- a/wp-includes/pluggable.php +++ b/wp-includes/pluggable.php @@ -1016,9 +1016,9 @@ if ( !function_exists('wp_salt') ) : * @return string Salt value from either 'SECRET_KEY' or 'secret' option */ function wp_salt() { - + global $wp_default_secret_key; $secret_key = ''; - if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ('put your unique phrase here' != SECRET_KEY) ) + if ( defined('SECRET_KEY') && ('' != SECRET_KEY) && ( $wp_default_secret_key != SECRET_KEY) ) $secret_key = SECRET_KEY; if ( defined('SECRET_SALT') ) { diff --git a/wp-settings.php b/wp-settings.php index cb8363e677..74459f93f8 100644 --- a/wp-settings.php +++ b/wp-settings.php @@ -275,6 +275,12 @@ if (strpos($_SERVER['PHP_SELF'], 'install.php') === false) { define('COOKIEHASH', $cookiehash); } +/** + * Should be exactly the same as the default value of SECRET_KEY in wp-config-sample.php + * @since 2.5 + */ +$wp_default_secret_key = 'put your unique phrase here'; + /** * It is possible to define this in wp-config.php * @since 2.0.0