X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=includes%2Futils%2FMWCryptHash.php;h=11173573e73375a43b50f6f786b5dda4d58cecf0;hb=3649eb7db23edd9a9fa302994e9e916c59288dab;hp=72c620eec0399a9b8f54966d97e39a8402d9aa67;hpb=a5b975edd132e52ee8ce1c725d8195da941c8b7b;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/utils/MWCryptHash.php b/includes/utils/MWCryptHash.php index 72c620eec0..11173573e7 100644 --- a/includes/utils/MWCryptHash.php +++ b/includes/utils/MWCryptHash.php @@ -105,6 +105,10 @@ class MWCryptHash { * @return string An hmac hash of the data + key */ public static function hmac( $data, $key, $raw = true ) { + if ( !is_string( $key ) ) { + // a fatal error in HHVM; an exception will at least give us a stack trace + throw new InvalidArgumentException( 'Invalid key type: ' . gettype( $key ) ); + } return hash_hmac( self::hashAlgo(), $data, $key, $raw ); }