CRM-17646 - Add hook_civicrm_fieldOptions + tests
[civicrm-core.git] / CRM / Utils / Signer.php
index ef8f9cf9262115f5a0f070c59afc9da87ebbfdcf..25c382af58bff9afa3f53f7ed20115179bfbe4e3 100644 (file)
@@ -29,8 +29,6 @@
  *
  * @package CRM
  * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
  */
 
 /**
@@ -99,7 +97,8 @@ class CRM_Utils_Signer {
           $params[$paramName] = (string) $params[$paramName];
         }
       }
-      else {// $paramName is not included or ===NULL
+      else {
+        // $paramName is not included or ===NULL
         $params[$paramName] = '';
       }
       $message['payload'][$paramName] = $params[$paramName];
@@ -122,7 +121,7 @@ class CRM_Utils_Signer {
   public function validate($token, $params) {
     list ($salt, $signature) = explode($this->signDelim, $token);
     if (strlen($salt) != self::SALT_LEN) {
-      throw new Exception("Invalid salt [$token]=[$salt][$signature]");
+      throw new Exception("Token contains invalid salt [" . urlencode($token) . "]");
     }
     $newToken = $this->sign($params, $salt);
     return ($token == $newToken);