Case-insensitive XML declaration detection per XML spec section 2.6
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 34/100
Direzione di ricerca
Start by reading the parser logic that classifies processing instruction targets and the related tests; the issue does not name specific files. Compare the existing lowercase xml declaration behavior with mixed-case targets and unterminated inputs from the table. Done means the parser exposes behavior that lets callers handle reserved case variants while preserving later parse errors and regular processing instructions.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
According to https://www.w3.org/TR/xml/#sec-pi:
The target names "XML", "xml", and so on are reserved for standardization in this or future versions of this specification.
This means PITarget names matching [Xx][Mm][Ll] (any case variant) are reserved and shouldn't be considered valid processing instructions.
Currently, quick-xml treats only lowercase <?xml as an XML declaration, while other case variants are treated as regular processing instructions.
The above is basically a standalone issue and probably should be addressed somehow. This is related to Ruffle and ideally should be solved in such a way that allows Ruffle to properly replicate Flash behaviour.
Here is a table laying out what is currently ok and what isn't:
| Input | quick-xml Event/Error | Flash Player behavior | Note |
|---|---|---|---|
<?xml version='1.0'?>\<r/\> |
Event::Decl |
XML declaration | ✓ Ok |
<?XML version='1.0'?>\<r/\> |
Event::PI |
XML declaration | ✓ Workaround possible: we can check Event::PI and treat it as an xml declaration |
<?XmL version='1.0'?>\<r/\> |
Event::PI |
XML declaration | ✓ Workaround possible: we can check Event::PI and treat it as an xml declaration |
<?xml version='1.0'? (unterminated) |
UnclosedXmlDecl |
Error #1092 (unterminated XML declaration) | ✓ Ok |
<?XML version='1.0'? (unterminated) |
UnclosedPI |
Error #1092 (unterminated XML declaration) | ✗ PI target not exposed in error, cannot distinguish from regular PI |
<?XmL version='1.0'? (unterminated) |
UnclosedPI |
Error #1092 (unterminated XML declaration) | ✗ PI target not exposed in error, cannot distinguish from regular PI |
<?test foo?\> |
Event::PI |
Processing instruction | ✓ Ok |
<?test foo? (unterminated) |
UnclosedPI |
Error #1097 (unterminated processing instruction) | ✓ Ok |
If an error was raised as soon as the parser encounters something like <?XmL, then parsing stops and Ruffle would have no chance to process the rest of the xml and for example raise an error about an unterminated xml declaration or any other error that would be encountered later.
One possible solution would be to treat all [Xx][Mm][Ll] case variants as XML declarations, since the spec reserves these names anyway.
Alternatively, new event/error types could be added (e.g., Event::ReservedPI / SyntaxError::UnclosedReservedPI) to let users decide how to handle them. However, this might be more complexity than needed.
- Lingua principale
- Rust
- Stelle
- 1.6k
- Fork
- 299
- Merge medio
- 2g 4h
- PR unite (30g)
- 9
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tafia/quick-xml
-
Parser accepts an empty element or attribute nameForse già presa @ychampion l’ha presa 1 giorno fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
DecodingReader::set_encoding panics when the XML declaration is longer than 64 bytesForse già presa @emschwartz l’ha presa 4 giorni fa. Apertabug encoding
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
tafia/quick-xml#1040 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
encoding optimization
Difficoltà 4/5 3-5 giorni Idoneità per principianti 55/100
tafia/quick-xml#1039 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
optimization question
Difficoltà 4/5 3-5 giorni Idoneità per principianti 52/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 4/5 1-2 giorni Idoneità per principianti 53/100
tafia/quick-xml#1035 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di tafia/quick-xml
Issue simili
-
[Bug]: opencode_go chat route drops reasoning_effort (even 'none'), while the same endpoint honors it via custom_llm_provider=openaiForse già presa @arvindkumar-ship-it l’ha presa oggi. Apertallm translation
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
BerriAI/litellm#51871 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
comp-formats
Difficoltà 2/5 Mezza giornata Idoneità per principianti 64/100
ClickHouse/ClickHouse#131694 ·
I maintainer di solito rispondono entro 1 giorno
-
cli: `execCargoMetadata` decodes stdout per chunk, corrupting non-ASCII paths across pipe boundariesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
C-Bug S-Needs-Triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bevyengine/bevy#26558 ·
I maintainer di solito rispondono entro 2 giorni