Skip to content
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

corrupted / mangled nested custom XML #203

Open
KyleSanderson opened this issue Mar 20, 2023 · 1 comment
Open

corrupted / mangled nested custom XML #203

KyleSanderson opened this issue Mar 20, 2023 · 1 comment
Labels

Comments

@KyleSanderson
Copy link

KyleSanderson commented Mar 20, 2023

Expected behavior

item.Custom["torrent"] returns the string contents of the XML.

Actual behavior

{"level":"error","module":"feed","feed":"emp","error":"XML syntax error on line 1: element <torrent> closed by </contentLengthHR>","time":"2023-03-14T21:46:39+01:00","message":"could not unmarshal item.Custom.Torrent"}

String returned: Cat.torrentA%2B%10%D5l%F2%BC%B3%F3%5E%D1%14qM%15%F2%26%C4%F0Z\n\t\t\t\t<contentLengthHR>58.34GiB</contentLengthHR>

Steps to reproduce the behavior

		<item>
			<title><![CDATA[[SomeData]]></title>
			<torrent xmlns="http://xmlns.ezrss.it/0.1/">
				<fileName><![CDATA[Cat.torrent]]></fileName>
				<infoHash><![CDATA[A%2B%10%D5l%F2%BC%B3%F3%5E%D1%14qM%15%F2%26%C4%F0Z]]></infoHash>
				<contentLength>62643697701</contentLength>
				<contentLengthHR>58.34 GiB</contentLengthHR>
			</torrent>
		</item>

Note: Please include any links to problem feeds, or the feed content itself!

I don't have access to the site where the user reported the issue from, but this is the feed item from there. Allegedly this format is popular for a group of sites.

@mmcdole
Copy link
Owner

mmcdole commented Mar 25, 2023

Yea, I see the issue with how we are calling parseText when we encounter an unknown tag, which is attempting to decode the element, which will fail if the the element has nested structure. The handling of this seems pretty insufficient.

I've created a feature enhancement here with #206 to discuss how to handle this properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants