Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge release 2.59.0 into 3.0.x #269

Merged
merged 6 commits into from
Jun 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/book/v2/validators/csrf.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CSRF Validator

CAUTION: **Deprecated**
This validator is deprecated in favour of the drop-in replacement validator shipped in version 2.21.0 of [`laminas-session`](https://docs.laminas.dev/laminas-session/).
The validator here will be removed in version 3.0 of `laminas-validator`.

`Laminas\Validator\Csrf` provides the ability to both generate and validate CSRF tokens.
This allows you to validate if a form submission originated from the same site, by confirming the value of the CSRF field in the submitted form is the same as the one contained in the original form.

Expand Down
5 changes: 5 additions & 0 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,11 @@
</TooManyArguments>
</file>
<file src="src/ValidatorPluginManager.php">
<DeprecatedClass>
<code><![CDATA[Csrf::class]]></code>
<code><![CDATA[Csrf::class]]></code>
<code><![CDATA[Csrf::class]]></code>
</DeprecatedClass>
<DeprecatedMethod>
<code><![CDATA[getServiceLocator]]></code>
<code><![CDATA[getServiceLocator]]></code>
Expand Down
4 changes: 4 additions & 0 deletions src/Csrf.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@
use function strtolower;
use function strtr;

/**
* @deprecated This validator will be removed in version 3.0 of this component. A replacement is available in
* version 2.21.0 of the laminas-session component: https://docs.laminas.dev/laminas-session/
*/
final class Csrf extends AbstractValidator
{
/**
Expand Down
5 changes: 5 additions & 0 deletions test/CsrfTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@
use function strtr;
use function uniqid;

/**
* @deprecated
*
* @psalm-suppress DeprecatedClass
*/
final class CsrfTest extends TestCase
{
private Csrf $validator;
Expand Down