App.js errors when entering special characters in series search field

Hey, just found this in the torrents branch (v2.0.0.2184), maybe it’s a problem in dev/master also, you be the judge.

When you enter an opening parenthesis “(” in the search field, you get this error:
app.js : 34829
SyntaxError: unterminated parenthetical

When you enter a closing parenthesis “)” in the search field, you get this error:
app.js : 34829
SyntaxError: unmatched ) in regular expression

Opening bracket “[” gives this one:
app.js : 34829
SyntaxError: unterminated character class

A closing bracket “]” seems fine.

I found this when I wanted to search for “The Killing (US)” but I couldn’t recall the name. I did know I had the original series as well as the US version, so I thought why not put “(US)” in the search field and it’ll pop right up :smile:

Why did I try the brackets? Don’t ask me, I found the first error and played around a bit… Maybe there’s more funky behavior when entering things besides a-z, I have no idea.

Yeah, its an issue, due to how the search term is built. I’ll take a look and see what I can find.

A fix for this is in develop.