Skip to content

Commit

Permalink
Fix Rollbar JS integration that wasn't functional
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffreymb committed Jun 21, 2018
1 parent 5c13cd1 commit 86666db
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Twig/RollbarExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ public function getFunctions()
}

return [
new \Twig_SimpleFunction('rollbarJs', [$this, 'rollbarJs']),
new \Twig_SimpleFunction('rollbarJs', [$this, 'rollbarJs'], [
'is_safe' => ['html'],
]),
];
}

Expand All @@ -59,7 +61,7 @@ public function rollbarJs()
{
$helper = new RollbarJsHelper($this->config['rollbar_js']);

$script = "<script>var _rollbarConfig = {{config}};\n{{rollbar-snippet}}</script>";
$script = "<script>{{config}};\n{{rollbar-snippet}}</script>";
$script = strtr($script, [
'{{config}}' => $helper->configJsTag(),
'{{rollbar-snippet}}' => $helper->jsSnippet(),
Expand Down

0 comments on commit 86666db

Please sign in to comment.