Skip to content

Commit

Permalink
Add replay variables to environment
Browse files Browse the repository at this point in the history
  • Loading branch information
David Vandemaele committed Aug 12, 2022
1 parent 2d68183 commit 2c6b74a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/Skeleton/Core/Web/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ public function display($template, $rewrite_html = true) {
*/
public function render($template, $rewrite_html = true) {
$csrf = Security\Csrf::get();

$this->add_environment('csrf_session_token_name', $csrf->get_session_token_name());
$this->add_environment('csrf_header_token_name', $csrf->get_header_token_name());
$this->add_environment('csrf_post_token_name', $csrf->get_post_token_name());
$this->add_environment('csrf_token', $csrf->get_session_token());

$replay = Security\Replay::get();
$this->add_environment('replay_session_tokens_name', $replay->get_session_tokens_name());
$this->add_environment('replay_header_token_name', $replay->get_header_token_name());
$this->add_environment('replay_post_token_name', $replay->get_post_token_name());

$output = $this->template->render($template);
$output = $csrf->inject($output);
Expand Down

0 comments on commit 2c6b74a

Please sign in to comment.