Skip to content
Snippets Groups Projects
Commit 8e73e460 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

#173858 by myself: skip UTF-8 BOM when importing locale files

parent 70d49462
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -1015,6 +1015,10 @@ function _locale_import_read_po($op, $file, $mode = NULL, $lang = NULL, $group =
while (!feof($fd)) {
$line = fgets($fd, 10*1024); // A line should not be this long
if ($lineno == 0) {
// The first line might come with a UTF-8 BOM, which should be removed.
$line = str_replace("\xEF\xBB\xBF", '', $line);
}
$lineno++;
$line = trim(strtr($line, array("\\\n" => "")));
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment