From 262e9b082a6016803c27c9def8604779480dc48f Mon Sep 17 00:00:00 2001 From: Chris Burgess Date: Mon, 6 Jun 2016 15:32:50 +0000 Subject: [PATCH] CRM-13640: Improve hash generator for logfile. WIP only. --- CRM/Core/Error.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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); } /** -- 2.25.1