Skip to content

[stable33] fix: support Twig date filter for ServerSignatureDate in JSign#7646

Merged
vitormattos merged 2 commits intostable33from
backport/7644/stable33
May 6, 2026
Merged

[stable33] fix: support Twig date filter for ServerSignatureDate in JSign#7646
vitormattos merged 2 commits intostable33from
backport/7644/stable33

Conversation

@backportbot-libresign
Copy link
Copy Markdown

Backport of PR #7644

Keep ${timestamp} for plain {{ServerSignatureDate}} templates so JSign can inject its signing timestamp, but provide an ISO date when the template transforms the value (for example with Twig date filters).

Add regression coverage for Twig date filter with timezone and keep compatibility assertion for the plain placeholder case.

Fixes #7619

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
PhpNativeHandler was setting ServerSignatureDate to a custom
'Y.m.d H:i:s UTC' string while JSignPdfHandler (after the prior
fix) and the preview context (SignatureTextService::parse) both
use DateTimeInterface::ATOM. This inconsistency could cause the
Twig |date() filter to fail or produce unexpected results in
PhpNativeHandler-signed documents.

Changes:
- PhpNativeHandler: use DateTimeImmutable::ATOM for ServerSignatureDate
- SignatureTextService::getAvailableVariables(): correct the
  description to state the variable CAN be formatted with Twig
- JSignPdfHandlerTest: add cases for {{ ServerSignatureDate }}
  with spaces, |date() without timezone, and GRAPHIC_ONLY +
  date filter
- PhpNativeHandlerTest: assert ServerSignatureDate is valid
  ISO 8601 / ATOM when passed to signatureTextService->parse()

Closes #7619

Signed-off-by: Vitor Mattos <1079143+vitormattos@users.noreply.github.com>
@github-project-automation github-project-automation Bot moved this to 0. Needs triage in Roadmap May 6, 2026
@backportbot-libresign backportbot-libresign Bot added this to the Next Patch (33) milestone May 6, 2026
@vitormattos vitormattos merged commit 8b59046 into stable33 May 6, 2026
69 checks passed
@vitormattos vitormattos deleted the backport/7644/stable33 branch May 6, 2026 14:01
@github-project-automation github-project-automation Bot moved this from 0. Needs triage to 4. to release in Roadmap May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: 4. to release

Development

Successfully merging this pull request may close these issues.

1 participant