Private GIT

Skip to content
Snippets Groups Projects
Commit 99defb86 authored by Nic Wolfe's avatar Nic Wolfe
Browse files

Merge pull request #217 from gleamicus/strip_tvdb_cr

TVDB doesn't sanitize \r (CR) from user input in some fields. Let's strip
parents 090ceb67 f4920025
Branches
Tags
No related merge requests found
...@@ -537,11 +537,11 @@ class Tvdb: ...@@ -537,11 +537,11 @@ class Tvdb:
""" """
src = self._loadUrl(url) src = self._loadUrl(url)
try: try:
return ElementTree.fromstring(src) return ElementTree.fromstring(src.rstrip('\r'))
except SyntaxError: except SyntaxError:
src = self._loadUrl(url, recache=True) src = self._loadUrl(url, recache=True)
try: try:
return ElementTree.fromstring(src) return ElementTree.fromstring(src.rstrip('\r'))
except SyntaxError, exceptionmsg: except SyntaxError, exceptionmsg:
errormsg = "There was an error with the XML retrieved from thetvdb.com:\n%s" % ( errormsg = "There was an error with the XML retrieved from thetvdb.com:\n%s" % (
exceptionmsg exceptionmsg
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment