Skip to content

Commit

Permalink
Remove tailScript code
Browse files Browse the repository at this point in the history
No longer used with the removal of U2F.

Fixes #506
  • Loading branch information
stwalkerster committed Jan 20, 2021
1 parent e6eeb08 commit ea46795
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
19 changes: 0 additions & 19 deletions includes/Fragments/TemplateOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,12 @@ trait TemplateOutput
{
/** @var Smarty */
private $smarty;
/** @var string Extra JavaScript to include at the end of the page's execution */
private $tailScript;
/** @var string */
private $tailScriptNonce;

/**
* @return SiteConfiguration
*/
protected abstract function getSiteConfiguration();

/**
* Include extra JavaScript at the end of the page's execution
*
* @param $nonce string CSP Nonce generated by ContentSecurityPolicyManager::getNonce()
* @param $script string JavaScript to include at the end of the page
*/
final protected function setTailScript($nonce, $script)
{
$this->tailScriptNonce = $nonce;
$this->tailScript = $script;
}

/**
* Assigns a Smarty variable
*
Expand Down Expand Up @@ -102,9 +86,6 @@ final protected function setUpSmarty()
*/
final protected function fetchTemplate($template)
{
$this->assign('tailScript', $this->tailScript);
$this->assign('tailScriptNonce', $this->tailScriptNonce);

return $this->smarty->fetch($template);
}
}
6 changes: 0 additions & 6 deletions templates/base.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,6 @@
{foreach from=$extraJs item=js}
<script src="{$baseurl}{$js.path|escape}" type="{$js.type|escape}" integrity="sha256-{$js.integrity}"></script>
{/foreach}

{if $tailScript}
<script type="text/javascript" nonce="{$tailScriptNonce}">
{$tailScript}
</script>
{/if}
{/block}
</body>
</html>

0 comments on commit ea46795

Please sign in to comment.