diff --git a/CHANGES.md b/CHANGES.md index 7a289c4c..fa22f801 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -44,6 +44,7 @@ * Fix failing "Providers" link on Config/Search Settings/Episode Search * Change case of labels in General Config/Interface/Timezone * Split enabled from not enabled providers in the Configure Provider drop down on the Providers Options tab +* Fix searches freezing due to unescaped ignored or required words [develop changelog] * Fix typo for commit "ShowData handler" i.e. SHA-1:3eec217 diff --git a/sickbeard/show_name_helpers.py b/sickbeard/show_name_helpers.py index a50fe06f..888d9092 100644 --- a/sickbeard/show_name_helpers.py +++ b/sickbeard/show_name_helpers.py @@ -59,20 +59,20 @@ def filterBadReleases(name, parse=True): # if any of the bad strings are in the name then say no if sickbeard.IGNORE_WORDS: resultFilters.extend(sickbeard.IGNORE_WORDS.split(',')) - filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in resultFilters] + filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in resultFilters] for regfilter in filters: if regfilter.search(name): - logger.log(u"Invalid scene release: " + name + " contains pattern: " + regfilter.pattern + ", ignoring it", + logger.log(u"Invalid scene release: " + name + " contained: " + regfilter.pattern + ", ignoring it", logger.DEBUG) return False # if any of the good strings aren't in the name then say no if sickbeard.REQUIRE_WORDS: require_words = sickbeard.REQUIRE_WORDS.split(',') - filters = [re.compile('(^|[\W_])%s($|[\W_])' % filter.strip(), re.I) for filter in require_words] + filters = [re.compile('(^|[\W_])%s($|[\W_])' % re.escape(filter.strip()), re.I) for filter in require_words] for regfilter in filters: if not regfilter.search(name): - logger.log(u"Invalid scene release: " + name + " doesn't contain pattern: " + regfilter.pattern + ", ignoring it", + logger.log(u"Invalid scene release: " + name + " didn't contain: " + regfilter.pattern + ", ignoring it", logger.DEBUG) return False