mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-07-23 23:11:04 -04:00
make scriptTag parameter a string for flexibility and clarity
This commit is contained in:
parent
7294ea7847
commit
d27e7e8ee3
4 changed files with 30 additions and 30 deletions
|
@ -63,15 +63,15 @@ class View
|
|||
*
|
||||
* @access private
|
||||
* @param string $file
|
||||
* @param bool $async should it execute ASAP or only after HTML got parsed
|
||||
* @param string $attributes additional attributes to add into the script tag
|
||||
*/
|
||||
private function _scriptTag($file, $async = true)
|
||||
private function _scriptTag($file, $attributes = '')
|
||||
{
|
||||
$sri = array_key_exists($file, $this->_variables['SRI']) ?
|
||||
' integrity="' . $this->_variables['SRI'][$file] . '"' : '';
|
||||
$suffix = preg_match('#\d.js$#', $file) == 0 ?
|
||||
'?' . rawurlencode($this->_variables['VERSION']) : '';
|
||||
echo '<script ', $async ? 'async' : 'defer',
|
||||
echo '<script ', $attributes,
|
||||
' type="text/javascript" data-cfasync="false" src="', $file,
|
||||
$suffix, '"', $sri, ' crossorigin="anonymous"></script>', PHP_EOL;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue