rutracker: no regex replace when SearchTerm is null. #13660 (#13664)

fix for https://github.com/Jackett/Jackett/pull/13661#issuecomment-1286567697
This commit is contained in:
ilike2burnthing 2022-10-21 16:32:21 +01:00 committed by GitHub
parent 4502f5f771
commit 00dc9f5dcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -1484,7 +1484,8 @@ namespace Jackett.Common.Indexers
var searchString = query.SearchTerm;
// replace any space, special char, etc. with % (wildcard)
var ReplaceRegex = new Regex("[^a-zA-Zа-яА-Я0-9]+");
searchString = ReplaceRegex.Replace(searchString, "%");
if (!string.IsNullOrWhiteSpace(searchString))
searchString = ReplaceRegex.Replace(searchString, "%");
// if the search string is empty use the getnew view
if (string.IsNullOrWhiteSpace(searchString))