mirror of
https://github.com/Jackett/Jackett.git
synced 2025-09-17 17:34:09 +02:00
Fix indexer class lookup by string when name has non-alphanumeric chars
This commit is contained in:
20
src/Jackett/Utils/StringUtil.cs
Normal file
20
src/Jackett/Utils/StringUtil.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Jackett.Utils
|
||||
{
|
||||
public static class StringUtil
|
||||
{
|
||||
public static string StripNonAlphaNumeric(string str)
|
||||
{
|
||||
Regex rgx = new Regex("[^a-zA-Z0-9 -]");
|
||||
str = rgx.Replace(str, "");
|
||||
return str;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user