X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FKey.php;h=5978833ca7bf9f67df5eb0bfbd972319f76c57d0;hb=5c4d65599fee6dfdf661b4932d12c5905e60ac90;hp=5ddd661c9b27c5cf9ed42e1d3a7fb1761f49f08e;hpb=5667521530926d61b370a4bb0806b7e5ad63ccbc;p=civicrm-core.git diff --git a/CRM/Core/Key.php b/CRM/Core/Key.php index 5ddd661c9b..5978833ca7 100644 --- a/CRM/Core/Key.php +++ b/CRM/Core/Key.php @@ -23,7 +23,7 @@ | GNU Affero General Public License or the licensing of CiviCRM, | | see the CiviCRM license FAQ at http://civicrm.org/licensing | +--------------------------------------------------------------------+ -*/ + */ /** * @@ -40,8 +40,8 @@ class CRM_Core_Key { /** * Generate a private key per session and store in session * - * @return string private key for this session - * @static + * @return string + * private key for this session */ public static function privateKey() { if (!self::$_key) { @@ -75,15 +75,16 @@ class CRM_Core_Key { * and a private key. Modelled after drupal's form API * * @param string $name - * @param bool $addSequence should we add a unique sequence number to the end of the key + * @param bool $addSequence + * Should we add a unique sequence number to the end of the key. * - * @return string valid formID - * @static + * @return string + * valid formID */ public static function get($name, $addSequence = FALSE) { $privateKey = self::privateKey(); - $sessionID = self::sessionID(); - $key = md5($sessionID . $name . $privateKey); + $sessionID = self::sessionID(); + $key = md5($sessionID . $name . $privateKey); if ($addSequence) { // now generate a random number between 1 and 100K and add it to the key @@ -100,8 +101,8 @@ class CRM_Core_Key { * @param string $name * @param bool $addSequence * - * @return string $formKey if valid, else null - * @static + * @return string + * if valid, else null */ public static function validate($key, $name, $addSequence = FALSE) { if (!is_string($key)) { @@ -152,4 +153,5 @@ class CRM_Core_Key { // ensure that hash is a 32 digit hex number return preg_match('#[0-9a-f]{32}#i', $hash) ? TRUE : FALSE; } + }