From: Chris Burgess Date: Mon, 6 Jun 2016 15:32:50 +0000 (+0000) Subject: CRM-13640: Improve hash generator for logfile. WIP only. X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=262e9b082a6016803c27c9def8604779480dc48f;p=civicrm-core.git CRM-13640: Improve hash generator for logfile. WIP only. --- diff --git a/CRM/Core/Error.php b/CRM/Core/Error.php index cc938288bc..d92687e7f7 100644 --- a/CRM/Core/Error.php +++ b/CRM/Core/Error.php @@ -651,11 +651,16 @@ class CRM_Core_Error extends PEAR_ErrorStack { * CRM-13640. */ protected static function generateLogFileHash($config) { + // Use multiple (but stable) inputs for hash information. TMI? $md5inputs = array( + defined('CIVICRM_SITE_KEY') ? CIVICRM_SITE_KEY : 'NO_SITE_KEY', + $config->userFrameworkBaseURL, md5($config->dsn), $config->dsn, ); - return md5(var_export($md5inputs,1)); + // Trim 8 chars off the string, make it slightly easier to find + // but reveals less information from the hash. + return substr(md5(var_export($md5inputs,1)), 8); } /**