Automattic / Automattic/nginx-http-concat
Duplicate ID defined in some instances
- Dominant language
- PHP
- Stars
- 120
- Forks
- 37
- PR merge metrics
- No merged PRs in 30d
Description
This ID:
https://github.com/Automattic/nginx-http-concat/blob/cda3f4cf09450c267657787de976d365fc30a845/cssconcat.php#L136
the `do_items()` function is called twice, once for the head, once for the footer. This means the loop that sets the number in the ID is run twice, resetting on the second instance, resulting in the doubled ID.
Simplest fix might be to increment the number sufficiently on one of the loops. e.g. adding between these lines
https://github.com/Automattic/nginx-http-concat/blob/cda3f4cf09450c267657787de976d365fc30a845/cssconcat.php#L110-L111
```
if ( $group ) { $idx += 1000; }
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Open cssconcat.php and inspect do_items(), especially the loop that assigns IDs and its calls for the head and footer. Reproduce the two calls and verify that generated IDs remain unique across both groups; the issue’s suggested index adjustment is one possible direction, not a required implementation.
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
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100