Make sure hash_hmac() always works even if no secret key
authorkaldari <rkaldari@wikimedia.org>
Fri, 27 Feb 2015 22:40:29 +0000 (14:40 -0800)
committerkaldari <rkaldari@wikimedia.org>
Fri, 27 Feb 2015 23:36:33 +0000 (15:36 -0800)
Otherwise a fatal error is possible.

Change-Id: Icda96bac3e75f424be068cdad30ad618b503a8e1

includes/TemplateParser.php

index 559ffb9..a178fed 100644 (file)
@@ -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