diff --git a/system/docs/CHANGELOG.md b/system/docs/CHANGELOG.md index ed16e177b1..9110f47538 100644 --- a/system/docs/CHANGELOG.md +++ b/system/docs/CHANGELOG.md @@ -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). diff --git a/system/modules/core/library/Contao/Combiner.php b/system/modules/core/library/Contao/Combiner.php index a9123e996f..9523abddb5 100644 --- a/system/modules/core/library/Contao/Combiner.php +++ b/system/modules/core/library/Contao/Combiner.php @@ -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'])) {