Merge pull request #12162 from seamuslee001/group_query_count
[civicrm-core.git] / CRM / Utils / Signer.php
index ef8f9cf9262115f5a0f070c59afc9da87ebbfdcf..a4a09bff7b683d698bbd8468a851080222f83bf8 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.7                                                |
+ | CiviCRM version 5                                                  |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2018                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -28,9 +28,7 @@
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2015
- * $Id$
- *
+ * @copyright CiviCRM LLC (c) 2004-2018
  */
 
 /**
@@ -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);