Skip to content

Commit

Permalink
Use comma instead of dot for value delimiter
Browse files Browse the repository at this point in the history
  • Loading branch information
GwendolenLynch committed Sep 3, 2022
1 parent 489a75d commit defbe00
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/Signer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function getSignedValue(string $value, ?string $signature = null): string
$signature = $this->generateSignature($value);
}

return $value.'.'.$signature;
return $value.','.$signature;
}

public function verifySignedValue(string $signedValue): bool
Expand Down Expand Up @@ -75,7 +75,7 @@ private function generateSignature(string $value): string
*/
private function splitSignatureFromSignedValue(string $signedValue): array
{
$pos = strrpos($signedValue, '.');
$pos = strrpos($signedValue, ',');
if (false === $pos) {
return [$signedValue, null];
}
Expand Down
8 changes: 4 additions & 4 deletions tests/Listener/SignedCookieListenerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ public function provideCookieReading(): array
[[], [], []],
[[], ['foo' => 'bar'], ['foo' => 'bar']],
[['foo'], ['foo' => 'bar'], []],
[['foo'], ['foo' => 'bar.ca3756f81d3728a023bdc8a622c0906f373b795e'], ['foo' => 'bar']],
[['*'], ['foo' => 'bar.ca3756f81d3728a023bdc8a622c0906f373b795e'], ['foo' => 'bar']],
[['foo'], ['foo' => 'bar,ca3756f81d3728a023bdc8a622c0906f373b795e'], ['foo' => 'bar']],
[['*'], ['foo' => 'bar,ca3756f81d3728a023bdc8a622c0906f373b795e'], ['foo' => 'bar']],
];
}

Expand Down Expand Up @@ -99,8 +99,8 @@ public function provideCookieWriting(): array
return [
[[], [], []],
[[], ['foo' => 'bar'], ['foo' => 'bar']],
[['foo'], ['foo' => 'bar'], ['foo' => 'bar.ca3756f81d3728a023bdc8a622c0906f373b795e']],
[['*'], ['foo' => 'bar'], ['foo' => 'bar.ca3756f81d3728a023bdc8a622c0906f373b795e']],
[['foo'], ['foo' => 'bar'], ['foo' => 'bar,ca3756f81d3728a023bdc8a622c0906f373b795e']],
[['*'], ['foo' => 'bar'], ['foo' => 'bar,ca3756f81d3728a023bdc8a622c0906f373b795e']],
];
}

Expand Down

0 comments on commit defbe00

Please sign in to comment.