Skip to content

avm2: Return correct error for unclosed tags #21107

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SuchAFuriousDeath
Copy link
Contributor

@SuchAFuriousDeath SuchAFuriousDeath commented Jul 26, 2025

Oops, this looks more complicated than initially thought

@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as draft July 26, 2025 09:55
@kjarosh kjarosh added A-avm2 Area: AVM2 (ActionScript 3) xml waiting-on-author Waiting on the PR author to make the requested changes T-fix Type: Bug fix (in something that's supposed to work already) labels Jul 26, 2025
The problem is that quick-xml returns the same error (UnclosedTag) in 2 distinct cases:
1. Unterminated attribute (Error 1095): <a b='/>
2. Malformed element (Error 1090): <a/><b></b

This commit adds logic to differentiate between these cases by:
- Checking if any XML events were successfully parsed before the error
- If no events were parsed, examining the XML content for attribute patterns
- If the content contains '=' and a quote character, it's Error 1095
- Otherwise, it's Error 1090
@SuchAFuriousDeath SuchAFuriousDeath marked this pull request as ready for review July 26, 2025 14:06
@SuchAFuriousDeath
Copy link
Contributor Author

I think I managed to fix it, but it's ugly :(

@kjarosh kjarosh added waiting-on-review Waiting on review from a Ruffle team member and removed waiting-on-author Waiting on the PR author to make the requested changes labels Jul 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-avm2 Area: AVM2 (ActionScript 3) T-fix Type: Bug fix (in something that's supposed to work already) waiting-on-review Waiting on review from a Ruffle team member xml
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants