From: kaldari Date: Fri, 27 Feb 2015 22:40:29 +0000 (-0800) Subject: Make sure hash_hmac() always works even if no secret key X-Git-Tag: 1.31.0-rc.0~12224^2 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=db1866da41404f25f97b062e1c8dad8c95809bbe;p=lhc%2Fweb%2Fwiklou.git Make sure hash_hmac() always works even if no secret key Otherwise a fatal error is possible. Change-Id: Icda96bac3e75f424be068cdad30ad618b503a8e1 --- diff --git a/includes/TemplateParser.php b/includes/TemplateParser.php index 559ffb9ba2..a178fed4c3 100644 --- a/includes/TemplateParser.php +++ b/includes/TemplateParser.php @@ -97,7 +97,7 @@ class TemplateParser { // Fetch a secret key for building a keyed hash of the PHP code $config = ConfigFactory::getDefaultInstance()->makeConfig( 'main' ); - $secretKey = $config->get( 'SecretKey' ); + $secretKey = $config->get( 'SecretKey' ) ? : 'key'; // See if the compiled PHP code is stored in cache. // CACHE_ACCEL throws an exception if no suitable object cache is present, so fall