summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
authorDavid Rothstein <drothstein@gmail.com>2013-06-03 18:06:36 -0400
committerDavid Rothstein <drothstein@gmail.com>2013-06-03 18:06:36 -0400
commit30a95c80f3a1f0259c388f2b07cab171ac9ba223 (patch)
treece0ef466f5002d59429f36faabf6cfc49826551c /includes/common.inc
parent43c8918f96612d6ab37e8ca122e0f7c0ac4520a1 (diff)
downloadbrdo-30a95c80f3a1f0259c388f2b07cab171ac9ba223.tar.gz
brdo-30a95c80f3a1f0259c388f2b07cab171ac9ba223.tar.bz2
Issue #1739986 by RobLoach, pwolanin, sun, Berdir, moshe weitzman, andypost, dcam: Fixed fallback in drupal_get_hash_salt(), move it to bootstrap.inc, use instead of $GLOBALS['drupal_hash_salt()'].
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc17
1 files changed, 3 insertions, 14 deletions
diff --git a/includes/common.inc b/includes/common.inc
index 31923f28b..3ec68636c 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5035,19 +5035,6 @@ function drupal_json_output($var = NULL) {
}
/**
- * Gets a salt useful for hardening against SQL injection.
- *
- * @return
- * A salt based on information in settings.php, not in the database.
- */
-function drupal_get_hash_salt() {
- global $drupal_hash_salt, $databases;
- // If the $drupal_hash_salt variable is empty, a hash of the serialized
- // database credentials is used as a fallback salt.
- return empty($drupal_hash_salt) ? hash('sha256', serialize($databases)) : $drupal_hash_salt;
-}
-
-/**
* Ensures the private key variable used to generate tokens is set.
*
* @return
@@ -5069,8 +5056,10 @@ function drupal_get_private_key() {
*
* @return string
* A 43-character URL-safe token for validation, based on the user session ID,
- * the global $drupal_hash_salt variable from settings.php, and the
+ * the hash salt provided from drupal_get_hash_salt(), and the
* 'drupal_private_key' configuration variable.
+ *
+ * @see drupal_get_hash_salt()
*/
function drupal_get_token($value = '') {
return drupal_hmac_base64($value, session_id() . drupal_get_private_key() . drupal_get_hash_salt());