| 7 common.inc | drupal_get_hash_salt() |
| 8 common.inc | 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.
3 calls to drupal_get_hash_salt()
File
- includes/
common.inc, line 4942 - Common functions that many Drupal modules will need to reference.
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;
}
Login or register to post comments