Skip to content

Commit

Permalink
typo
Browse files Browse the repository at this point in the history
  • Loading branch information
JanTvrdik committed Aug 3, 2016
1 parent cc197b0 commit b7c3cca
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand All @@ -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), '+/', '-_');

Expand Down

0 comments on commit b7c3cca

Please sign in to comment.