JS entités

This commit is contained in:
Fred Tempez 2023-03-20 11:41:20 +01:00
parent df88e5a195
commit 19c6c403d7
2 changed files with 3 additions and 4 deletions

View File

@ -562,8 +562,6 @@ class helper
// Supprime les tabulations, espaces, nouvelles lignes, etc... // Supprime les tabulations, espaces, nouvelles lignes, etc...
$js = str_replace(["\r\n", "\r", "\t", "\n", ' ', ' ', ' '], '', $js); $js = str_replace(["\r\n", "\r", "\t", "\n", ' ', ' ', ' '], '', $js);
$js = preg_replace(['(( )+\))', '(\)( )+)'], ')', $js); $js = preg_replace(['(( )+\))', '(\)( )+)'], ')', $js);
// Convertir les codes entités
$js = htmlspecialchars_decode($js);
// Retourne le js minifié // Retourne le js minifié
return $js; return $js;
} }

View File

@ -1043,8 +1043,9 @@ class layout extends common
if ($this->core->output['inlineScript']) { if ($this->core->output['inlineScript']) {
$inlineScript = implode($this->core->output['inlineScript']); $inlineScript = implode($this->core->output['inlineScript']);
} }
echo '<script defer>' . helper::minifyJs( $coreScript) . '</script>'; echo '<script defer>' . helper::minifyJs($coreScript . $this->core->output['script'] . htmlspecialchars_decode($inlineScript)) . '</script>';
echo '<script defer>' . helper::minifyJs( $inlineScript) . '</script>';
} }
/** /**