aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua M. Boniface <joshua@boniface.me>2019-12-06 15:13:23 -0500
committerJoshua Boniface <joshua@boniface.me>2019-12-06 15:16:09 -0500
commit292d4b585b53e6185191274921d09309f3499236 (patch)
tree71a4de31222dff5f56d29563ebec1697bafe34a6
parent0dd08bbbb41a1ff6511f477c82878ad4c0103771 (diff)
Merge pull request #2104 from cvium/avoid_catastrophic_backtracking
Simplify regex to avoid catastrophic backtracking (cherry picked from commit 6f283d80dc00fe63b59dfb7a134528f295615da7) Signed-off-by: Joshua Boniface <joshua@boniface.me>
-rw-r--r--Emby.Naming/Common/NamingOptions.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Emby.Naming/Common/NamingOptions.cs b/Emby.Naming/Common/NamingOptions.cs
index d37be0e63..4c2c43437 100644
--- a/Emby.Naming/Common/NamingOptions.cs
+++ b/Emby.Naming/Common/NamingOptions.cs
@@ -314,7 +314,7 @@ namespace Emby.Naming.Common
// This isn't a Kodi naming rule, but the expression below causes false positives,
// so we make sure this one gets tested first.
// "Foo Bar 889"
- new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?<seriesname>(\w+\s*?)*)\s(?<epnumber>\d{1,3})(-(?<endingepnumber>\d{2,3}))*[^\\\/]*$")
+ new EpisodeExpression(@".*[\\\/](?![Ee]pisode)(?<seriesname>[\w\s]+?)\s(?<epnumber>\d{1,3})(-(?<endingepnumber>\d{2,3}))*[^\\\/]*$")
{
IsNamed = true
},
@@ -337,7 +337,7 @@ namespace Emby.Naming.Common
// *** End Kodi Standard Naming
                // [bar] Foo - 1 [baz]
- new EpisodeExpression(@".*?(\[.*?\])+.*?(?<seriesname>(\w+\s*?)+?)[-\s_]+(?<epnumber>\d+).*$")
+ new EpisodeExpression(@".*?(\[.*?\])+.*?(?<seriesname>[\w\s]+?)[-\s_]+(?<epnumber>\d+).*$")
{
IsNamed = true
},