Automattic / Automattic/nginx-http-concat

Bug in concatenation

Open Beginner friendly
#49 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
PHP
Stars
120
Forks
37
PR merge metrics
No merged PRs in 30d

Description

There seems to be a bug in the concatenation code surrounding charsets, which adds a character that prevents files from downloading correctly:

When concatenating files, if any of them has a BOM present (or one of the files is UTF-8 encoded or contains unicode), the BOM should be stripped, prepended to the output, and the encoding headers updated.

Each file is modified from here: https://github.com/Automattic/nginx-http-concat/blob/623aa7b4135783b847f56d1da1df988851518769/ngx-http-concat.php#L161

What’s needed is a check for a BOM, and if found, replace it with an empty string, and set a flag, and if that flag is found, prepend the BOM on the final output.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in ngx-http-concat.php around line 161, where each concatenated file is modified, and trace the charset and BOM handling. Verify the result by concatenating files with and without a BOM or Unicode content: the output should contain at most the required leading BOM, with encoding headers updated and no extra character that prevents downloads.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
web-dev
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.