Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Remove the UTF-8 BOM when combining files (see #8689).
Browse files Browse the repository at this point in the history
  • Loading branch information
ausi authored and leofeyer committed Apr 18, 2017
1 parent 813ac56 commit 96df7b0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions system/modules/core/library/Contao/Combiner.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ public function getCombinedFile($strUrl=null)
{
$content = file_get_contents(TL_ROOT . '/' . $arrFile['name']);

// Remove UTF-8 BOM
if (strncmp($content, "\xEF\xBB\xBF", 3) === 0)
{
$content = substr($content, 3);
}

// HOOK: modify the file content
if (isset($GLOBALS['TL_HOOKS']['getCombinedFile']) && is_array($GLOBALS['TL_HOOKS']['getCombinedFile']))
{
Expand Down

0 comments on commit 96df7b0

Please sign in to comment.