Skip to content

Commit

Permalink
Merge pull request #7 from jeffreymb/fix_js
Browse files Browse the repository at this point in the history
Fix Rollbar JS integration that wasn't functional
  • Loading branch information
OxCom authored Jun 21, 2018
2 parents 5c13cd1 + 86666db commit 005fe1e
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 005fe1e

Please sign in to comment.