Please sign in to comment.
bug #27454 [FrameworkBundle][TwigBridge] Fix BC break from strong dep…
…endency on CSRF token storage (tgalopin) This PR was merged into the 4.1 branch. Discussion ---------- [FrameworkBundle][TwigBridge] Fix BC break from strong dependency on CSRF token storage | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | - | License | MIT | Doc PR | - The PR #25197 introduced the `csrf_token` function in Twig. This extension relies on `CsrfTokenManagerInterface`, which itself relies on the session. In some contexts such as when sessions are stored in Redis and we try to warmup the cache in CLI without Redis available, this makes the process fails. This PR fixes this by using a Twig runtime instead of a direct extension to avoid a strong dependency on `CsrfTokenManagerInterface`. Commits ------- 68994a6 [FrameworkBundle][TwigBridge] Fix BC break from strong dependency on CSRF token storage
- Loading branch information...
Showing with 40 additions and 15 deletions.
|@@ -0,0 +1,33 @@|
|* This file is part of the Symfony package.|
|* (c) Fabien Potencier <email@example.com>|
|* For the full copyright and license information, please view the LICENSE|
|* file that was distributed with this source code.|
|* @author Christian Flothmann <firstname.lastname@example.org>|
|* @author Titouan Galopin <email@example.com>|
|public function __construct(CsrfTokenManagerInterface $csrfTokenManager)|
|$this->csrfTokenManager = $csrfTokenManager;|
|public function getCsrfToken(string $tokenId): string|