function drupal_get_hash_salt

drupal_get_hash_salt()

Gets a salt useful for hardening against SQL injection.

Return value

A salt based on information in settings.php, not in the database.

File

includes/bootstrap.inc, line 2552
Functions that need to be loaded on every Drupal request.

Code

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;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/includes!bootstrap.inc/function/drupal_get_hash_salt/7.x