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 da5d8e9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Contao Open Source CMS changelog
Version 3.5.26 (2017-XX-XX)
---------------------------

### Fixed
Remove the UTF-8 BOM when combining files (see #8689).

### Fixed
Do not add the CORS headers in the install tool (see #8681).

Expand Down
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 da5d8e9

Please sign in to comment.