diff --git a/src/Helpers.php b/src/Helpers.php index 773bd7b..20a1e66 100644 --- a/src/Helpers.php +++ b/src/Helpers.php @@ -16,13 +16,14 @@ class Helpers { /** * Returns unique token for method and params + * * @param Session $session - * @param string $controlName + * @param string $controlClassName * @param string $method * @param array $params * @return string */ - public static function getCsrfToken(Session $session, $controlName, $method, array $params) + public static function getCsrfToken(Session $session, $controlClassName, $method, array $params) { $sessionSection = $session->getSection('Nextras.Application.UI.SecuredLinksPresenterTrait'); if (!isset($sessionSection->token)) { @@ -34,7 +35,7 @@ public static function getCsrfToken(Session $session, $controlName, $method, arr $params = Nette\Utils\Arrays::flatten($params); $params = implode('|', array_keys($params)) . '|' . implode('|', array_values($params)); - $data = $controlName . $method . $params . $session->getId(); + $data = $controlClassName . $method . $params . $session->getId(); $hash = hash_hmac('sha1', $data, $sessionSection->token, TRUE); $token = strtr(substr(base64_encode($hash), 0, 8), '+/', '-_');