diff --git a/Core/StoredCsrf.php b/Core/StoredCsrf.php index ae16119..79c50dd 100644 --- a/Core/StoredCsrf.php +++ b/Core/StoredCsrf.php @@ -58,6 +58,6 @@ private function solid(string $token): bool { * @return string */ private function twin(): string { - return ($this->get + $this->post)[self::NAME] ?? self::INVALID_TOKEN; + return ($this->post + $this->get)[self::NAME] ?? self::INVALID_TOKEN; } } \ No newline at end of file diff --git a/Tests/Unit/StoredCsrf.phpt b/Tests/Unit/StoredCsrf.phpt index d9cea1d..b12075d 100644 --- a/Tests/Unit/StoredCsrf.phpt +++ b/Tests/Unit/StoredCsrf.phpt @@ -128,10 +128,10 @@ final class StoredCsrf extends Tester\TestCase { Assert::true($csrf->abused()); } - public function testMatchingGetWithPrecedence() { + public function testMatchingPostWithPrecedence() { $this->session[Csrf\Csrf::NAME] = str_repeat('a', 22); - $this->get[Csrf\Csrf::NAME] = str_repeat('a', 22); - $this->post[Csrf\Csrf::NAME] = str_repeat('b', 30); + $this->get[Csrf\Csrf::NAME] = str_repeat('b', 30); + $this->post[Csrf\Csrf::NAME] = str_repeat('a', 22); $csrf = new Csrf\StoredCsrf($this->session, $this->post, $this->get); Assert::false($csrf->abused()); }